Android: Apk signed file does not include external library and throws "java.lang.ExceptionInInitializerError"

I recently signed an apk file for release on Google Play, and when I downloaded the application on Google Play and installed it, it would throw a java.lang.ExceptionInInitializerError.

My colleague and I suspect that the library was not added to our signed apk file.

We added our additional library to our project, adding it to our build path for the project.

In addition, the library we are trying to add to our project is ActionBarSherlock.

Is there a reason our library is not included in our signed apk file because we notice that the file size for our signed apk is much smaller than our unsigned version?

Can someone point us in the right direction when signing our apk file correctly so that it includes the library that we added to our build path?

+4
source share
3 answers

I had the same error as the jar file android.support.v4 . deeJ is right, if you look at the ActionBarSherlock website, it tells you to add the following to your proguard file:

-keep class android.support.v4.app.** { *; } -keep interface android.support.v4.app.** { *; } -keep class com.actionbarsherlock.** { *; } -keep interface com.actionbarsherlock.** { *; } -keepattributes *Annotation* 
+4
source

I found out that the problem is that Proguard does not work very well with ActionBarSherlock. Try using the tips given here:

http://actionbarsherlock.com/faq.html

+2
source

Not sure about your exact build process, my suggestion would be to use Maven for your builds. Perhaps your dependencies depend only on your debug build, and not on your build. Another thing that I would like to suggest, before putting something in the application store, use Android Debug Bridge (adb) to manually install it on the device and check for these errors.

0
source

Source: https://habr.com/ru/post/1434934/


All Articles