Android Proguard configuration for the v7 Support Library ActionBar

前端 未结 3 1474
孤街浪徒
孤街浪徒 2020-12-10 10:07

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.

相关标签:
3条回答
  • 2020-12-10 10:52

    I use this, somewhat similar to what the v4 version suggested:

    -keep class android.support.v7.internal.** { *; }
    -keep interface android.support.v7.internal.** { *; }
    
    0 讨论(0)
  • 2020-12-10 10:53

    I solved it with:

    -dontwarn android.support.v7.**
    -keep class android.support.v7.** { *; }
    -keep interface android.support.v7.** { *; }
    
    0 讨论(0)
  • I got it from Android Proguard Snippet

    -keep public class android.support.v7.widget.** { *; }
    -keep public class android.support.v7.internal.widget.** { *; }
    -keep public class android.support.v7.internal.view.menu.** { *; }
    
    -keep public class * extends android.support.v4.view.ActionProvider {
        public <init>(android.content.Context);
    }
    

    Hope it will work.

    0 讨论(0)
提交回复
热议问题