How to put jar file new gradle build ?

136 views
Skip to first unread message

Narayan G. Maharjan

unread,
Jan 8, 2015, 8:39:26 AM1/8/15
to javafx...@googlegroups.com, Dave Binding, Mike Tallent
Hi, 
I was working on making javafx to work in android with new gradle script. I was able to create apk file with new gradle script but I am not sure how set the Jar file which contains our real javafx codes in gradle. I currently added them inside assets dir and changed AndroidManifest.xml to launch the mainclass from that jar file, but when I run it from android it gives me error.  Am I doing the right process or are there any alternate correct way of adding main application jar.

Thanks

Johan Vos

unread,
Jan 9, 2015, 2:18:44 PM1/9/15
to javafx...@googlegroups.com, dbin...@gmail.com, mike...@gmail.com
Typically, when you use the android-gradle script, you have the source code for the application inside your project, in the src directory. The android gradle plugin takes care of creating the jar and putting it in the right place.

- Johan

Stefan Fuchs

unread,
Jan 9, 2015, 4:54:36 PM1/9/15
to javafx...@googlegroups.com, dbin...@gmail.com, mike...@gmail.com
Or you can look into https://bitbucket.org/javafxports/8u-dev-build/src/dc2a9d362b2d12d901fc0f93f544a6f46a9685b7/samples/Ensemble8/build.gradle?at=default

, which builds the Ensemble8.apk from a precompiled Ensemble8.jar file. It uses some special magic to pass the jar file through retrolambda.

Stefan


Johan Vos wrote:
--
You received this message because you are subscribed to the Google Groups "JavaFXAndroid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javafxandroi...@googlegroups.com.
To post to this group, send email to javafx...@googlegroups.com.
Visit this group at http://groups.google.com/group/javafxandroid.
To view this discussion on the web visit https://groups.google.com/d/msgid/javafxandroid/36900bc5-7ccf-4bbd-b87e-36fcca79fe74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike

unread,
Jan 9, 2015, 5:14:28 PM1/9/15
to Stefan Fuchs, javafx...@googlegroups.com, Dave Binding
Thank you guys.

Narayan G. Maharjan

unread,
Jan 10, 2015, 3:15:17 PM1/10/15
to javafx...@googlegroups.com, dbin...@gmail.com, mike...@gmail.com
I used the build script of Emsemble8 to run my application but I get this exception:

 warning: Ignoring InnerClasses attribute for an anonymous inner class (javax.xml.xpath.XPathFactoryFinder$2) that doesn't come with an
        associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly
        indicate that it is *not* an inner class.

        UNEXPECTED TOP-LEVEL ERROR:
        java.lang.OutOfMemoryError: Java heap space
                at com.android.dx.dex.code.RopTranslator.outputBlock(RopTranslator.java:253)
                at com.android.dx.dex.code.RopTranslator.outputInstructions(RopTranslator.java:233)
                at com.android.dx.dex.code.RopTranslator.translateAndGetResult(RopTranslator.java:212)
                at com.android.dx.dex.code.RopTranslator.translate(RopTranslator.java:105)
                at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:317)
                at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:137)
                at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:93)
                at com.android.dx.command.dexer.Main.processClass(Main.java:729)
                at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
                at com.android.dx.command.dexer.Main.access$300(Main.java:82)
                at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602)
                at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
                at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
                at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
                at com.android.dx.command.dexer.Main.processOne(Main.java:632)                at com.android.dx.command.dexer.Main.processAllFiles(Main.java:505)
                at com.android.dx.command.dexer.Main.runMultiDex(Main.java:332)
                at com.android.dx.command.dexer.Main.run(Main.java:243)
                at com.android.dx.command.dexer.Main.main(Main.java:214)
                at com.android.dx.command.Main.main(Main.java:106)




Does that have something to do with source target ?

Thanks
Reply all
Reply to author
Forward
0 new messages