-
Notifications
You must be signed in to change notification settings - Fork 831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ExceptionInInitializerError on master in Android app #410
Comments
Not sure about ProGuard, I've never used it (and I've only played with Android several years ago). Maybe ProGuard would have to be run with jdk8, targeting whatever java/android version you want to support? Re ExceptionInInitializerError: it seems that the java.version system property indicates java 8 - what's the exact value that's returned for java.version? In general, I'd really love to be able to test android compatibility (for some versions) in jenkins. How could that be done? |
there's the maven-android plugin along with an instrumentation test. the jenkins slave will need the android sdk installed and the ability to run an emulator (headless if necessary). i may be able to whip up a test case for it |
so this is going to may take some additional effort and some code isolation to separate the android test cases from the rest of the code base. in addition, those building from source would need the android sdk installed. not sure how you want to proceed that said, i've been using kryo for a while on android and only ran into the the problem post 3.0.1 (probably post 3.0.3) without issue, aside from the lack of thread safety. |
lastly, java.version, is not available as a system property or system environment variable. at least it's not on my device |
Re building with android sdk: mvn profiles might be helpful, or maybe running/building in docker. Re java.version: interesting, I wasn't aware of this. Then we should check if the relevant classes are available. |
@spyhunter99 I've changed the guard, so that we now check if a class is available instead of checking the java version. Can you please test if it's now working for you? |
ok i'll give it a shot On Thu, Mar 24, 2016 at 5:07 PM, Martin Grotzke [email protected]
|
Success! Here's the pro guard settings i used for future reference #kryo ##java8 stuff that doesnt' exists in adk |
Great that it's working! |
As a result of the addition of OptionalSerializers and TimeSerializers, both of which target Java 1.8+, Kryo does not appear to work on Android when ProGuard is applied to the resultant application (APK). In order for ProGuard to even successfully complete, I had to add the following to the configuration (which is admittedly probably not the right thing to do):
-dontwarn java.time.*
-dontwarn java.util.*
Once on device, I get the following while creating a new Kryo
java.lang.ExceptionInInitializerError
at com.esotericsoftware.kryo.serializers.OptionalSerializers.addDefaultSerializers(OptionalSerializers.java:41)
at com.esotericsoftware.kryo.Kryo.(Kryo.java:219)
at com.esotericsoftware.kryo.Kryo.(Kryo.java:155)
The text was updated successfully, but these errors were encountered: