Bug 35684 - Crash on UpdateMenu on Samsung 4.2.2 devices
Summary: Crash on UpdateMenu on Samsung 4.2.2 devices
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 1.5.1
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Paul DiPietro [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2015-11-09 09:15 UTC by Caan Mee
Modified: 2017-03-02 17:24 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Caan Mee 2015-11-09 09:15:23 UTC
We are currently experiencing crashes on some Samsung devices.

Would be nice if we could get a way to override 

Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.UpdateMenu() behaviour.


Proguard is disabled and the exception happens even if the linker is disabled:


Java.Lang.NoClassDefFoundErrorandroid.support.v7.internal.view.menu.MenuBuilder

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x00028>
at Android.Runtime.JNIEnv.CallObjectMethod (intptr,intptr) <0x000ab>
at Android.Support.V7.Widget.Toolbar.get_Menu () <0x000ab>
at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.UpdateMenu () <0x0003f>
at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.ToolbarTrackerOnCollectionChanged (object,System.EventArgs) <0x0001b>
at Xamarin.Forms.ToolbarTracker.EmitCollectionChanged () <0x0003b>
at Xamarin.Forms.ToolbarTracker.set_Target (Xamarin.Forms.Page) <0x00063>
at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1<Xamarin.Forms.NavigationPage>) <0x004df>
at Xamarin.Forms.Platform.Android.VisualElementRenderer`1<Xamarin.Forms.NavigationPage>.SetElement (Xamarin.Forms.NavigationPage) <0x0031b>
at Xamarin.Forms.Platform.Android.VisualElementRenderer`1<Xamarin.Forms.NavigationPage>.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement) <0x00063>
at Xamarin.Forms.Platform.Android.RendererFactory.GetRenderer (Xamarin.Forms.VisualElement) <0x0007b>
at Xamarin.Forms.Platform.Android.MasterDetailContainer.set_ChildView (Xamarin.Forms.VisualElement) <0x0008f>
at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer.UpdateDetail () <0x0003b>
at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement) <0x0051b>
at Xamarin.Forms.Platform.Android.RendererFactory.GetRenderer (Xamarin.Forms.VisualElement) <0x0007b>
at Xamarin.Forms.Platform.Android.AppCompat.Platform.AddChild (Xamarin.Forms.VisualElement,bool) <0x0003b>
at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage (Xamarin.Forms.Page) <0x0024b>
at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.InternalSetPage (Xamarin.Forms.Page) <0x00243>
at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.SetMainPage () <0x00023>
at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.LoadApplication (Xamarin.Forms.Application) <0x001a3>
at MyApp.MainActivity.OnCreate (Android.OS.Bundle) <0x00e9f>
at Android.Support.V4.App.FragmentActivity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) <0x0005b>
at (wrapper dynamic-method) object.0ddb87eb-ef41-4fbf-8665-06eb2612998e (intptr,intptr,intptr) <0x00043>

  --- End of managed exception stack trace ---
java.lang.NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder
	at android.support.v7.widget.ActionMenuView.getMenu(ActionMenuView.java:643)
	at android.support.v7.widget.Toolbar.ensureMenu(Toolbar.java:876)
	at android.support.v7.widget.Toolbar.getMenu(Toolbar.java:847)
	at md5b3a82eecd525c0791b0b016a92cda9ac.MainActivity.n_onCreate(Native Method)
	at md5b3a82eecd525c0791b0b016a92cda9ac.MainActivity.onCreate(MainActivity.java:46)
	at android.app.Activity.performCreate(Activity.java:5122)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1150)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2315)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2403)
	at android.app.ActivityThread.access$600(ActivityThread.java:165)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loop(Looper.java:194)
	at android.app.ActivityThread.main(ActivityThread.java:5391)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:525)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
	at dalvik.system.NativeStart.main(Native Method)


http://stackoverflow.com/questions/26657348/appcompat-v7-v21-0-0-causing-crash-on-samsung-devices-with-android-v4-2-2
Comment 1 Rui Marinho 2016-06-28 15:20:05 UTC
Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description. If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue, we would very much appreciate it. 

For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,
Xamarin Forms Team
Comment 2 Stephen Shaw 2016-11-03 02:48:43 UTC
It seems like this might be very specific to Samsung 4.2.2 (I can't reproduce on samsung 4.3). Seems like there is a lot of stuff out there about this too. I found this:
http://stackoverflow.com/questions/24809580/noclassdeffounderror-android-support-v7-internal-view-menu-menubuilder
Comment 3 Paul DiPietro [MSFT] 2017-03-02 17:24:36 UTC
I'm going to close this and mark it as not reproducible until we get a more concrete reproduction. To the original reporter: if you're able to provide a reproduction project, please do so as requested before by Rui and attach it here.