I'm using ProGuard for the first time. I have all my activities, fragments, list fragments, and the like inside the root package of my project (I tried to move them but made no difference). I'm using the standard proguard-android.txt
plus the proguard-project.txt
where I can put anything I want, it makes no difference to these classes, because they are just ignored.
They're not listed in usage.txt
,seeds.txt
, mapping.txt
or dump.txt
, and they're not in the dex (library classes seem to be correctly treated though).
I tried with -keep public class <my.project.rootpackage>.MyActivity
one for every ignored class, and many other things, the last one is:
-dontshrink
-dontoptimize
-dontobfuscate
-keep public class * extends android.app.Application
-keep public class * extends android.support.v4.app.FragmentActivity
-keep public class * extends android.support.v4.app.Fragment
-keep public class * extends android.support.v4.app.ListFragment
-keep public class * extends android.preference.PreferenceActivity
I could be using a simpler project while learning, but I don't see why it shouldn't work, after all ProGuard seems to handle well the libraries. Of course, the project works well when built in debug mode.
ProGuard updated to v4.8, Eclipse 3.7.2, ADT and SDK updated, project target API 15, no messages from ProGuard.
What am I missing? I admit I've never had clear the build process. Do I have to learn Ant?
EDIT: when it doesn't work (that is, ProGuard finishes with an error), I often get this kind of errors:
Warning: my.project.package.ClassA: can't find referenced class my.project.package.ClassB
Note that the two classes can also be in the same package.