appcompat-v7 v21.0.0 causing crash on Samsung devices with Android v4.2.2 appcompat-v7 v21.0.0 causing crash on Samsung devices with Android v4.2.2 android android

appcompat-v7 v21.0.0 causing crash on Samsung devices with Android v4.2.2


I found the proper solution here: https://stackoverflow.com/a/26641388/1266123

By using

-keep class !android.support.v7.internal.view.menu.**,android.support.v7.** {*;}

instead of

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


As #150 from https://code.google.com/p/android/issues/detail?id=78377 said

Because careful with -keep class !android.support.v7.internal.view.menu.**. There are a number of classes in there which are referenced from the appcompat's resources.

The better solution is add the following lines instead:

-keep class !android.support.v7.internal.view.menu.MenuBuilder, !android.support.v7.internal.view.menu.SubMenuBuilder, android.support.v7.** { *; }-keep interface android.support.v7.** { *; }


Since Appcompat 23.1.1 the .internal package in the AppCompat jar was removed.

Updated fix using proguard:

#FOR APPCOMPAT 23.1.1:-keep class !android.support.v7.view.menu.*MenuBuilder*, android.support.v7.** { *; }-keep interface android.support.v7.* { *; }