Reputation: 14051
Everything in my debug APK works just fine. However, when I export my APK and install it, everything works fine until I make a call to a referenced library.
E/AndroidRuntime(32571): at com.znood.znoodapp.ShowResultsActivity.a (Unknown Source)
I am using ProGuard.
My libraries are in the libs directory and are added to build path.
Any pointers are highly appreciated =)
Upvotes: 2
Views: 1906
Reputation: 14051
The problem was with the Google Gson library. Proguard converts class names into obfuscated ones rendering json conversion buggy.
In order to solve this problem, make sure to have the following in your proguard-project.txt
# the classes that you use for Gson conversion
-keep class com.yourapp.objects.** { *; }
# without this line, I was having ClassCastException
-keepattributes Signature, *Annotation*
I hope this helps someone =)
Upvotes: 2
Reputation: 6326
If you haven't defined your libraries in proguard-project.txt
then you can add like this
-libraryjars /libs/smack.jar
-libraryjars /libs/libphonenumber-5.0v1.5.jar
Android obfuscate app using proguard keeps obfuscating library jars - or is it?
Upvotes: 1