Bug 39446 - Android: Hard crashes with "Java.Lang.NoSuchMethodError: no method with name='isDestroyed'"
Summary: Android: Hard crashes with "Java.Lang.NoSuchMethodError: no method with name=...
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.1.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-03-08 12:58 UTC by Kirill
Modified: 2016-08-10 13:37 UTC (History)
9 users (show)

Tags: ac regression
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:

Description Kirill 2016-03-08 12:58:21 UTC
Xamarin Forms
Xamarin for Visual Studio
Visual Studio 2015

Android 4.1.1 or 4.1.2 (< 17 api)

Error throw when set MainPage if before MainPage already been installed NavigationPage

Application.Current.MainPage = new NavigationPage(new MyPage);

Similar Error: http://stackoverflow.com/questions/15891669/nosuchmethod-isdestroyed

Error Stack:

Java.Lang.LinkageErrorno method with name='isDestroyed' signature='()Z' in class Landroid/app/Activity;
Android.Runtime.JNIEnv.GetMethodID(IntPtr kls, string name, string signature)
Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.Dispose(bool disposing)
Rg.Forms.Droid.Renderers.Pages.RgNavigationPageRenderer.Dispose(bool disposing)
Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage(Page newRoot)
Xamarin.Forms.Platform.Android.FormsAppCompatActivity.InternalSetPage(Page page)
Xamarin.Forms.Platform.Android.FormsAppCompatActivity.AppOnPropertyChanged(object sender, PropertyChangedEventArgs args)
Xamarin.Forms.BindableObject.OnPropertyChanged(string propertyName)
Xamarin.Forms.Element.OnPropertyChanged(string propertyName)
Xamarin.Forms.Application.set_MainPage(Page value)
Rg.Forms.Services.NavigationService.OpenPage(Page page)
Rg.Forms.Services.NavigationService.OpenNavigationPage(Page page)
Rg.Forms.Services.NavigationService.OpenNavigationPage<TViewModel>(Action<_,_> initialiser, object[] args)
at mileluxe.ViewModels.Pages.LoginViewModel+<<get_LoginCommand>b__6_0>d.MoveNext () [0x00095] in <filename unknown>:0
Java.Lang.IRunnableInvoker.n_Run(IntPtr jnienv, IntPtr native__this)
at (wrapper dynamic-method) System.Object:7970fd5d-e65b-4a83-aa31-9f4445b5c22d (intptr,intptr)
--- End of managed exception stack trace ---
java.lang.NoSuchMethodError: no method with name='isDestroyed' signature='()Z' in class Landroid/app/Activity;
mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:29)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
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:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
dalvik.system.NativeStart.main(Native Method)
Comment 1 Jason Smith [MSFT] 2016-03-10 20:38:34 UTC
Thank you
Comment 2 Trevor 2016-04-06 15:27:31 UTC
This is a critical bug for us, affecting many Android 4.0.4 and 4.1 users. For us the call stack is:

Java.Lang.LinkageErrorno method with name='isDestroyed' signature='()Z' in class Landroid/app/Activity;
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x5e4a60d0 + 0x00024> in <filename unknown>:0 
  at Android.Runtime.JNIEnv.GetMethodID (IntPtr kls, System.String name, System.String signature) <0x5cfb0f88 + 0x000bf> in <filename unknown>:0 
  at Android.App.Activity.get_IsDestroyed () <0x5e4a5250 + 0x0004b> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.Dispose (Boolean disposing) <0x5e4a4978 + 0x000af> in <filename unknown>:0 
  at Java.Lang.Object.Dispose () <0x5cf7d920 + 0x0001f> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.MasterDetailContainer.DisposeChildRenderers () <0x5e4a48b8 + 0x0003b> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.MasterDetailContainer.set_ChildView (Xamarin.Forms.VisualElement value) <0x5dfb1ab8 + 0x0003f> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer.UpdateDetail () <0x5dfcd720 + 0x0003b> in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer.HandlePropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) <0x5dfde950 + 0x0006f> in <filename unknown>:0 
  at (wrapper delegate-invoke) <Module>:invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs)
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) <0x5df44188 + 0x0005b> in <filename unknown>:0 
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) <0x5df43fe8 + 0x00027> in <filename unknown>:0 
  at Xamarin.Forms.MasterDetailPage.set_Detail (Xamarin.Forms.Page value) <0x5dfa98e0 + 0x000af> in <filename unknown>:0 
  at FunTimesX.Shared.HomeView.NavigateAsync (MenuType id) <0x5dfa14d0 + 0x006bb> in <filename unknown>:0 
  at FunTimesX.Shared.MenuPage.<MenuPage>m__0 (System.Object sender, Xamarin.Forms.ItemTappedEventArgs args) <0x5fb146a0 + 0x0006b> in <filename unknown>:0 
  at Xamarin.Forms.ListView.NotifyRowTapped (Int32 groupIndex, Int32 inGroupIndex, Xamarin.Forms.Cell cell) <0x5fb14170 + 0x0016f> in <filename unknown>:0
Comment 3 Chris 2016-04-18 19:16:06 UTC
Can anyone from Xamarin provide an update on the status of this bug? This is a critical bug for my current project. 

Thank you.
Comment 4 Rui Marinho 2016-04-20 15:12:18 UTC
Should be fixed in 2.2.0-pre3
Comment 5 Miha Markic 2016-08-10 13:37:18 UTC
I doubt that this is Forms related error, or is it? I mean it happens even without Forms when accessing AppCompatActivity.IsDestroyed method.