Reputation: 1596
When i click on the application to lunch, it crashes out with this exception.
java.lang.NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder
at android.support.v7.app.AppCompatDelegateImplV7.initializePanelMenu(AppCompatDelegateImplV7.java:1038)
at android.support.v7.app.AppCompatDelegateImplV7.preparePanel(AppCompatDelegateImplV7.java:1102)
at android.support.v7.app.AppCompatDelegateImplV7.doInvalidatePanelMenu(AppCompatDelegateImplV7.java:1399)
at android.support.v7.app.AppCompatDelegateImplV7.access$100(AppCompatDelegateImplV7.java:89)
at android.support.v7.app.AppCompatDelegateImplV7$1.run(AppCompatDelegateImplV7.java:126)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5299)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
at dalvik.system.NativeStart.main(Native Method)
I have studied this link appcompat-v7 v21.0.0 causing crash on Samsung devices with Android v4.2.2 very similarl to my problem. but can't make it.
Upvotes: 2
Views: 2134
Reputation: 348
Steps to fix this: Add the following lines to the proguard file:
-keep class * extends android.support.v7.internal.view.menu.MenuBuilder
-keep class * implements android.support.v7.internal.view.menu.MenuBuilder
-keep class android.support.v7.internal.view.menu.MenuBuilder
Then, refresh the build in your IDE, and build the APK again.
"Why is this happening?"
Well, NoClassDefFoundErrors
happen when a class went missing at runtime, but was compiled.
I hope I helped you!
Upvotes: 4