I\'m new to using Proguard so I\'m probably making a newbie mistake. I\'ve got an app that after I run the release build (which uses Proguard to obfuscate) it crashes prett
I had a similar problem when proGuard encrypted the jsoup lib. I fixed it by adding the following to my proguard-rules.txt:
-keep class org.jsoup** {
*;
}
So the build.gradle will end up with the following section:
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
You have commented your library jar directives in the Proguard config.
Change:
# -libraryjars /libs/protobuf-2.3.0.jar
# -libraryjars /libs/libmessaging.jar
to:
-libraryjars /libs/protobuf-2.3.0.jar
-libraryjars /libs/libmessaging.jar
(and then don't bother defining your library jars in your build.xml)
EDIT:
I found another way to make Proguard leave library jars alone was to ask it to preserve their package names, eg:
-keep class javax.** { *; }
-keep class org.** { *; }
-keep class twitter4j.** { *; }