Android Proguard configuration for the v7 Support Library ActionBar

Mirko N. picture Mirko N. · Aug 17, 2013 · Viewed 19.6k times · Source

I'm using the v7 Support Library to show an ActionBar on Android 2.x. It works well enough but I had to fix a few class/method not found errors after enabling Proguard.

Are there any guidelines on which classes need to be preserved?

So far I have these:

-keep public class android.support.v7.internal.widget.ActionBarContainer
-keep class android.support.v7.internal.widget.ActionBarView$HomeView
-keep public class android.support.v7.internal.widget.ActionBarContextView

It seems to work now but I'm not that confident that it won't crash at some stage because of some other supposedly internal class referenced in some XML file.

Answer

Ivan Morgillo picture Ivan Morgillo · Jul 24, 2014

I solved it with:

-dontwarn android.support.v7.**
-keep class android.support.v7.** { *; }
-keep interface android.support.v7.** { *; }