• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Samsung App Launch Bug

I am trying to build an app for a Samsung Galaxy Light (with Android 4.2.2), but there is a known bug with class names that causes a NoClassDefFoundException on startup. The stacktrace:

Code:
    java.lang.NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder
            at android.support.v7.app.ActionBarActivityDelegateBase.initializePanelMenu(ActionBarActivityDelegateBase.java:995)
            at android.support.v7.app.ActionBarActivityDelegateBase.preparePanel(ActionBarActivityDelegateBase.java:1057)
            at android.support.v7.app.ActionBarActivityDelegateBase.doInvalidatePanelMenu(ActionBarActivityDelegateBase.java:1352)
            at android.support.v7.app.ActionBarActivityDelegateBase.access$100(ActionBarActivityDelegateBase.java:92)
            at android.support.v7.app.ActionBarActivityDelegateBase$1.run(ActionBarActivityDelegateBase.java:131)
            at android.os.Handler.handleCallback(Handler.java:725)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:176)
            at android.app.ActivityThread.main(ActivityThread.java:5299)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
            at dalvik.system.NativeStart.main(Native Method)

This is just starting a blank app from Android Studio!

I have been trying to fix the problem for a while, using solutions like enabling proguard, but that didn't help.

Anybody know what I can do?

Thanks!
 
Welcome to our AndroidForums, ExcelsiorVFX :).

I've seen this on occasion on a few of my apps, but it seems to be a rare an almost non-repeatable issue--for me, at least. I remember see the plethora of results in a Google search but nothing definitive as far as a solution...

Are you getting / seeing it consistently even in your Android Studio setup?

I don't have an answer or solution for you, other than perhaps try building it in Eclipse, too.
 
Welcome to our AndroidForums, ExcelsiorVFX :).

I've seen this on occasion on a few of my apps, but it seems to be a rare an almost non-repeatable issue--for me, at least. I remember see the plethora of results in a Google search but nothing definitive as far as a solution...

Are you getting / seeing it consistently even in your Android Studio setup?

I don't have an answer or solution for you, other than perhaps try building it in Eclipse, too.

Yes, I see it everywhere.

*sad face* Even in eclipse.

Oh well, I guess I will just use an emulator instead of a real phone.
Thanks for your help.
 
Ah, no worries...is it just barfing on the Galaxy Light or on other devices, too?

If you post the relevant code snippets that can re-create the issue, I'll try to see how it works on my machine and devices (I've got an HTC Droid Eris, Moto Droid 2 Global, Samsung Galaxy Nexus, LG Nexus 5, and an Asus Nexus 7 I can test on).
 
And here is more of the stacktrace:

Code:
03-25 21:18:48.898    1893-1893/me.excelsiorvfx.bhtvnotifier E/dalvikvm﹕ Could not find class 'android.support.v7.internal.view.menu.MenuBuilder', referenced from method android.support.v7.app.ActionBarActivityDelegateBase.initializePanelMenu
03-25 21:18:49.328    1893-1893/me.excelsiorvfx.bhtvnotifier E/dalvikvm﹕ Could not find class 'android.support.v7.internal.view.menu.MenuBuilder', referenced from method android.support.v7.widget.Toolbar.ensureMenu
03-25 21:18:49.388    1893-1893/me.excelsiorvfx.bhtvnotifier E/dalvikvm﹕ Could not find class 'android.support.v7.internal.view.menu.MenuBuilder', referenced from method android.support.v7.internal.widget.ActionBarContextView.initForMode
03-25 21:18:49.428    1893-1893/me.excelsiorvfx.bhtvnotifier E/dalvikvm﹕ Could not find class 'android.support.v7.internal.view.menu.MenuBuilder', referenced from method android.support.v7.internal.widget.ToolbarWidgetWrapper.setMenu
03-25 21:18:49.928    1893-1893/me.excelsiorvfx.bhtvnotifier E/﹕ Device driver API match
    Device driver API version: 20
    User space API version: 20
03-25 21:18:49.928    1893-1893/me.excelsiorvfx.bhtvnotifier E/﹕ mali: REVISION=Linux-r3p2-01rel2 BUILD_DATE=Mon Sep  2 14:16:28 KST 2013
03-25 21:18:49.973    1893-1893/me.excelsiorvfx.bhtvnotifier E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder
            at android.support.v7.app.ActionBarActivityDelegateBase.initializePanelMenu(ActionBarActivityDelegateBase.java:995)
            at android.support.v7.app.ActionBarActivityDelegateBase.preparePanel(ActionBarActivityDelegateBase.java:1057)
            at android.support.v7.app.ActionBarActivityDelegateBase.doInvalidatePanelMenu(ActionBarActivityDelegateBase.java:1352)
            at android.support.v7.app.ActionBarActivityDelegateBase.access$100(ActionBarActivityDelegateBase.java:92)
            at android.support.v7.app.ActionBarActivityDelegateBase$1.run(ActionBarActivityDelegateBase.java:131)
            at android.os.Handler.handleCallback(Handler.java:725)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:176)
            at android.app.ActivityThread.main(ActivityThread.java:5299)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
            at dalvik.system.NativeStart.main(Native Method)
 
Okay, so I enabled proguard and added
Code:
-keep class !android.support.v7.internal.view.menu.MenuBuilder,!android.support.v7.internal.view.menu.SubMenuBuilder, android.support.v7.**{*;}
-keep interface android.support.v7.**{*;}
to my proguard-rules.pro

But it didn't work...
Hmm.
 
Back
Top Bottom