0

I'm trying to use JavaFX in my android device, with the help of javafxports. I used the XStream to parse some XML file in my program. When i compile them, the javafxports outputs the following warnings:

Note: there were 9 classes trying to access annotations using reflection.
  You should consider keeping the annotation attributes
  (using '-keepattributes *Annotation*').
  (http://proguard.sourceforge.net/manual/troubleshooting.html#attributes)
Note: there were 32 classes trying to access generic signatures using reflection.
  You should consider keeping the signature attributes
  (using '-keepattributes Signature').
  (http://proguard.sourceforge.net/manual/troubleshooting.html#attributes)
Note: there were 56 unresolved dynamic references to classes or interfaces.
  You should check if you need to specify additional program jars.
  (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Note: there were 3 class casts of dynamically created class instances.
  You might consider explicitly keeping the mentioned classes and/or
  their implementations (using '-keep').
  (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclasscast)
Note: there were 39 accesses to class members by means of introspection.
  You should consider explicitly keeping the mentioned class members
  (using '-keep' or '-keepclassmembers').
  (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclassmember)
Note: you're ignoring all warnings!

The output .apk can be installed and run until it calls the xstream classes to read annotations in my classes. The reason is actually described in the warnings.

So my question is, how can i disable the proguard when generating .apk, or send it a custom proguard.pro configuration.

And my build.gradle is almost the same as that in the helloworld example.

Thanks.

Zi Berg
  • 1
  • 1
  • i found the code in "javafxmobile-plugin\src\main\groovy\org\javafxports\jfxmobile\plugin\JFXMobilePlugin.groovy"(line 274, version 1.0.7). Should i modify them and build the plugin myself? – Zi Berg Apr 04 '16 at 10:02
  • Can you run `adb logcat -v threadtime` and check the output for possible exceptions while running the app? – José Pereda Apr 04 '16 at 12:54
  • I found the reason. The annotations are still in the .dex file. What is wrong is that i defined a wrong classloader tree. – Zi Berg Apr 05 '16 at 16:11
  • Thanks for reporting back. Essentially proguard wasn't doing anything (`dontobfuscate()`, `dontoptimize()`, ...) – José Pereda Apr 05 '16 at 16:19

0 Answers0