Most projects will include a list of ProGuard rules they need added in order to function correctly.
If they don't you will need to play some hit and miss until you get a good compile (and decent size reduction).
Are you using this default ruleset?
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt")
That contains a set of rules that will cover all basic requirements for an Android App. You can then add your own rules in an additional config file:
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard.cfg"
If you are getting errors related to R
then you are probably not running a correct base config.
For example, in proguard-android-optimize.txt
it ensures that R
is correctly maintained:
-keepclassmembers class **.R$* {
public static <fields>;
}