I try to use ProGuard in tandem with JavaFXMobile to program a cross compatible android app with scala.
During the process I recieve the following warnings:
Maybe it's something else and the warnings don't cause the black screen, but I don't know for sure.
I added the gradle file and the rules in the links below.
I made it a bit more simple for me. I kept everything except the scala-parts. I knew it would work then, since it also worked in the desktop compilation. I figured, that the fault lies with javafx-mobile. The Plugin can't work with scalafx (sadly). I tested the same script on a different project and everything worked fine.
The reason I specify jars in the rules, is because they weren't added automatically. I could do it in my custom task, but I don't see the difference. Maybe I am missing something, but for ordinary jars (non Android) you have to create a custom task anyway, right?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I try to use ProGuard in tandem with JavaFXMobile to program a cross compatible android app with scala.
During the process I recieve the following warnings:
As a result the compiled app just turns the screen of my phone black and doesn't do anything else.
There seems to be a way to force proguard to use library-classes, when using the jar . As described here:
https://sourceforge.net/p/proguard/discussion/182455/thread/76430d9e/#9d8c
But so far I couldn't find this option inside the gradle-app
Maybe it's something else and the warnings don't cause the black screen, but I don't know for sure.
I added the gradle file and the rules in the links below.
Thank you for the Help!
Further information:
https://github.com/JulienSt/javafxmobile-scala-test/blob/master/build.gradle
https://github.com/JulienSt/javafxmobile-scala-test/blob/master/proguard-rules.pro
https://github.com/javafxports/javafxmobile-plugin/issues/70
https://stackoverflow.com/questions/52501318/preferring-library-classes-over-program-classes-in-proguard
And here is the complete log-output of my app while dying:
https://github.com/JulienSt/javafxmobile-scala-test/blob/master/log.txt
Last edit: Julien Stengel 2018-09-25
You should never specify -injars, -outjars, or -libraryjars in your ProGuard rules. The Android Gradle plugin specifies them for you.
The NoSuchMethodError may be coming from native code trying to access the listed method by reflection. You then need to keep the method, e.g.
I haven't looked into the implementation though.
I made it a bit more simple for me. I kept everything except the scala-parts. I knew it would work then, since it also worked in the desktop compilation. I figured, that the fault lies with javafx-mobile. The Plugin can't work with scalafx (sadly). I tested the same script on a different project and everything worked fine.
The reason I specify jars in the rules, is because they weren't added automatically. I could do it in my custom task, but I don't see the difference. Maybe I am missing something, but for ordinary jars (non Android) you have to create a custom task anyway, right?