Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Building .jar plugin
Started by Maciej Czekala Jan 18 2018 11:02 PM

14 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Maciej Czekala

[GLOBAL: userInfoPane.html]
Maciej Czekala
  • Enthusiast

  • 51 posts
  • Corona SDK

Hi,

 

I have a problem with building .jar file for my plugin via corona native.

 

In manual it says that plugin will build automatically when project is build, build.gradle indicated the same but I don't get jar file but instead I get plugin\build\outputs\aar\plugin-release.aar. 

 

There is no directory for jar.

 

How to build plugin in jar version so I can submit it to marketplace?



[TOPIC: post.html]
#2

Maciej Czekala

[GLOBAL: userInfoPane.html]
Maciej Czekala
  • Enthusiast

  • 51 posts
  • Corona SDK

Anyone?



[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,373 posts
  • Enterprise

Let me see if I can get an engineer to respond to this.

 

Rob



[TOPIC: post.html]
#4

Kirill Toporkov

[GLOBAL: userInfoPane.html]
Kirill Toporkov
  • Observer

  • 8 posts
  • Corona Staff

Hi!
 
According to my experience to build jar you need to run "Clean" then the sequence of gradle tasks: build -> exportPluginJar, then the result jar file will be placed to '/plugin/build/outputs/jar/<plugin_name>.jar'. Also there is another way to get your jar: you can find classes.jar in '/plugin/build/intermediates/bundles/release/' and then rename it to proper plugin name (that is what 'exportPluginJar' task does).
 

Kirill



[TOPIC: post.html]
#5

RedBeach

[GLOBAL: userInfoPane.html]
RedBeach
  • Corona Geek

  • 1,132 posts
  • Corona SDK

I am having the same issue. No Jar is built and there is no bundles/release folder.

 

On plugin build.gradle (Corona 2018.3233) it is trying to get the classes.jar from "$buildDir/intermediates/bundles/default/". but that  "default" folder also does not exist.

 

Can someone confirm that Jar plugin building is really working?



[TOPIC: post.html]
#6

RedBeach

[GLOBAL: userInfoPane.html]
RedBeach
  • Corona Geek

  • 1,132 posts
  • Corona SDK

Ok. I think I found the issue.

 

The classes.jar is being saved at "android/plugin/build/intermediates/intermediate-jars/release" (or "android/plugin/build/intermediates/intermediate-jars/debug"), and the gradle script, as I mentioned earlier, is trying to get the classes.jar ".../intermediates/bundles/default/", so it is not finding it and therefore we don't see it on the "build/outputs/jar/".



[TOPIC: post.html]
#7

nandgate

[GLOBAL: userInfoPane.html]
nandgate
  • Enthusiast

  • 80 posts
  • Corona SDK

Thought I'd bump this topic up.  Has this bug been logged? While not a huge deal, it'd be nice for the default project to work as expected out of the box.



[TOPIC: post.html]
#8

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,373 posts
  • Enterprise

Let me see if I can get an update.

 

Rob



[TOPIC: post.html]
#9

bjoern

[GLOBAL: userInfoPane.html]
bjoern
  • Enthusiast

  • 76 posts
  • Corona SDK

Any news on this?

Is using the classes.jar file from "android/plugin/build/intermediates/intermediate-jars/release" the correct way?

 

Best regards!



[TOPIC: post.html]
#10

uerceg

[GLOBAL: userInfoPane.html]
uerceg
  • Observer

  • 5 posts
  • Corona SDK

This should definitely be read from intermediate-jars folder. Seems to me that Corona people simply didn't notice that underlying Android build folder paths changed and have left old folder structure inside of the default `build.gradle` project inside of the App template. Would be good if you can update this since it's simply wrong.



[TOPIC: post.html]
#11

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 610 posts
  • Corona Staff

yes, you're correct. We should edit the contents of the template project/build script



[TOPIC: post.html]
#12

uerceg

[GLOBAL: userInfoPane.html]
uerceg
  • Observer

  • 5 posts
  • Corona SDK

If you plan to double check things in project templates, you might as well take a look at default App.xcodeproj because App target from template project is also not buildable due to the fact that by default you are setting path in there to be:

path = "~/Library/Application Support/Corona/Native";

instead of:

path = "$HOME/Library/Application Support/Corona/Native";


[TOPIC: post.html]
#13

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 610 posts
  • Corona Staff

uerceg, this is fixed a while ago, but we can't really update existing projects you have.

 

Same goes for Android Studio template. While next daily build would have a fixed version of the template, you'll have to apply fix to your projects yourself. Luckily it is quite a small change to android/plugin/build.gradle, replacing part of file with this lines.



[TOPIC: post.html]
#14

uerceg

[GLOBAL: userInfoPane.html]
uerceg
  • Observer

  • 5 posts
  • Corona SDK

@vlads Yeah, fixes are not big, I have performed them on existing projects, but reason I wrote this was because this is what I noticed literally 2 days ago when I downloaded latest Corona build (2018.3326) and from there I checked Corona/Native/Project Template/App/ios/App.xcodeconfig content. In there path is set with ~ and not $HOME. I was not checking nightly builds, rather just official version.



[TOPIC: post.html]
#15

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 610 posts
  • Corona Staff

You can download daily builds from https://developer.coronalabs.com/downloads/coronasdk/ (press download button in header of https://coronalabs.com/)

 

There was about 130 builds since 2018.3326, our last public release, and template was updated around 3378 (latest daily build is 2019.3459).




[topic_controls]
[/topic_controls]