This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 46494 - Hardware/Software back button from MainPage of type MasterDetail causes crash 'java.lang.IllegalStateException: Activity has been destroyed'
Summary: Hardware/Software back button from MainPage of type MasterDetail causes crash...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android (show other bugs)
Version: 2.3.3
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
: 53702 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-11-04 16:42 UTC by ischmitz
Modified: 2017-07-19 06:53 UTC (History)
24 users (show)

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


Attachments

Description ischmitz 2016-11-04 16:42:22 UTC
Overview:
I'm seeing an exception ('java.lang.IllegalStateException: Activity has been destroyed') that crashes my app when the user uses the hardware/software back button from the root MainPage of my app when it is of type MasterDetail. If I use a regular Page instead of MasterDetail as my MainPage, the crash does not occur.

Steps to Reproduce:
1) Setup MainPage to use a MasterDetail. 
2) After app loads the MasterDetail, use the hardware or software back button which will close application since it is the root Page.
3) Observe exception

Build Date & Hardware:
Occurs on Xamarin.Forms 2.3.3-pre3 and 2.3.3-pre4 running on Nexus 6 (Android 7.0).
Compiled using Android SDK 24. Min SDK 19. Target 24.

Stack trace: 

  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3819/96c7ba6c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
  at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method) [0x00084] in /Users/builder/data/lanes/3819/5a02b032/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:11464 
  at Android.Runtime.JNIEnv.CallIntMethod (System.IntPtr jobject, System.IntPtr jmethod) [0x00000] in /Users/builder/data/lanes/3819/5a02b032/source/monodroid/src/Mono.Android/JNIEnv.g.cs:186 
  at Android.Support.V4.App.FragmentTransactionInvoker.CommitAllowingStateLoss () [0x00033] in <27c17fe440cf491ba8255bcefade6e02>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailContainer.Dispose (System.Boolean disposing) [0x00042] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\MasterDetailContainer.cs:130 
  at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/3819/5a02b032/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203 
  at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer.Dispose (System.Boolean disposing) [0x00046] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\MasterDetailPageRenderer.cs:192 
  at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/3819/5a02b032/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203 
  at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x0003f] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:226 
  at Xamarin.Forms.Platform.Android.AppCompat.Platform.Dispose () [0x00010] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:52 
  at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy () [0x0002f] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:195 
  at Android.App.Activity.n_OnDestroy (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in /Users/builder/data/lanes/3819/5a02b032/source/monodroid/src/Mono.Android/platforms/android-24/src/generated/Android.App.Activity.cs:2981 
  at (wrapper dynamic-method) System.Object:b4f537f5-a711-449c-9bf3-d2540956cdc2 (intptr,intptr)
  --- End of managed Java.Lang.IllegalStateException stack trace ---
java.lang.IllegalStateException: Activity has been destroyed
    at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1515)
    at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:638)
    at android.support.v4.app.BackStackRecord.commitAllowingStateLoss(BackStackRecord.java:621)
    at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.n_onDestroy(Native Method)
    at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.onDestroy(FormsAppCompatActivity.java:80)
    at android.app.Activity.performDestroy(Activity.java:6866)
    at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1153)
    at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4154)
    at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4185)
    at android.app.ActivityThread.-wrap6(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1521)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6077)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Comment 1 adrianknight89 2016-11-04 18:46:03 UTC
Referencing https://github.com/xamarin/Xamarin.Forms/pull/444
Comment 2 adrianknight89 2016-11-04 19:32:17 UTC
See https://github.com/xamarin/Xamarin.Forms/pull/505
Comment 3 ischmitz 2016-11-24 17:11:39 UTC
Looks good. Thanks for getting the fix in so quickly.

Will this make it in one of the 2.3.4 pre-releases?
Comment 4 adrianknight89 2016-11-24 17:14:10 UTC
It's already merged, so I'd expect to see it soon.
Comment 5 ischmitz 2016-11-24 17:19:31 UTC
Actually looks like it's already in the 2.3.4-pre1.

It wasn't listed in the release notes but I do see the commit as part of the release.

Thanks again
Comment 6 Samantha Houts 2016-12-08 00:31:17 UTC
Confirmed! Should be fixed in 2.3.4-pre1. Thank you!
Comment 7 Sylvain Gravel 2016-12-28 22:25:40 UTC
I don't see 2.3.4-pre1 on Nuget...
Comment 8 Taylor Buchanan 2016-12-28 22:35:49 UTC
Unfortunately, it's not that I'm aware of. You can grab the NuGet package on GitHub and reference it in your NuGet.config.

https://github.com/xamarin/Xamarin.Forms/releases/tag/beta-2.3.4-pre1

Word of caution: 2.3.4-pre1 also breaks alerts and prompts on iOS 8... *sigh*
Comment 9 Sylvain Gravel 2016-12-28 22:44:17 UTC
Which explains why it was removed.  I installed it from the console only on Android and it does fix my issue.  Thanks!
Comment 10 Mohamed 2017-01-13 23:14:42 UTC
I installed version 2.3.4.184-pre1 available on nuget.
 
Unfortunately, the bug is still there.

Stacktrace:

Unhandled Exception:

Java.Lang.IllegalStateException: Activity has been destroyed

01-14 00:09:03.791 I/MonoDroid( 8009): UNHANDLED EXCEPTION:
01-14 00:09:03.807 I/MonoDroid( 8009): Java.Lang.IllegalStateException: Activity has been destroyed
01-14 00:09:03.807 I/MonoDroid( 8009):   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3511/501e63ce/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
01-14 00:09:03.807 I/MonoDroid( 8009):   at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method) [0x00084] in /Users/builder/data/lanes/3511/501e63ce/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:11464 
01-14 00:09:03.807 I/MonoDroid( 8009):   at Android.Runtime.JNIEnv.CallIntMethod (System.IntPtr jobject, System.IntPtr jmethod) [0x00000] in /Users/builder/data/lanes/3511/501e63ce/source/monodroid/src/Mono.Android/JNIEnv.g.cs:186 
01-14 00:09:03.807 I/MonoDroid( 8009):   at Android.Support.V4.App.FragmentTransactionInvoker.CommitAllowingStateLoss () [0x00033] in <27c17fe440cf491ba8255bcefade6e02>:0 
01-14 00:09:03.807 I/MonoDroid( 8009):   at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailContainer.Dispose (System.Boolean disposing) [0x00042] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\MasterDetailContainer.cs:130 
01-14 00:09:03.807 I/MonoDroid( 8009):   at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/3511/501e63ce/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203 
01-14 00:09:03.808 I/MonoDroid( 8009):   at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer.Dispose (System.Boolean disposing) [0x00046] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\MasterDetailPageRenderer.cs:192 
01-14 00:09:03.808 I/MonoDroid( 8009):   at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/3511/501e63ce/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203 
01-14 00:09:03.808 I/MonoDroid( 8009):   at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x0003f] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:226 
01-14 00:09:03.808 I/MonoDroid( 8009):   at Xamarin.Forms.Platform.Android.AppCompat.Platform.Dispose () [0x00010] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:52 
01-14 00:09:03.808 I/MonoDroid( 8009):   at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy () [0x0002f] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:195 
01-14 00:09:03.808 I/MonoDroid( 8009):   at MasjidIDA.Droid.MainActivity.OnDestroy () [0x00012] in C:\Users\moham\Documents\Git\MasjidIDA\MasjidIDA\MasjidIDA.Droid\MainActivity.cs:80 
01-14 00:09:03.808 I/MonoDroid( 8009):   at Android.App.Activity.n_OnDestroy (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in /Users/builder/data/lanes/3511/501e63ce/source/monodroid/src/Mono.Android/platforms/android-24/src/generated/Android.App.Activity.cs:2981 
01-14 00:09:03.808 I/MonoDroid( 8009):   at (wrapper dynamic-method) System.Object:169ee778-334d-4161-b428-9dd4fec3055f (intptr,intptr)
01-14 00:09:03.808 I/MonoDroid( 8009):   --- End of managed Java.Lang.IllegalStateException stack trace ---
01-14 00:09:03.808 I/MonoDroid( 8009): java.lang.IllegalStateException: Activity has been destroyed
01-14 00:09:03.808 I/MonoDroid( 8009): 	at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1515)
01-14 00:09:03.808 I/MonoDroid( 8009): 	at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:638)
01-14 00:09:03.808 I/MonoDroid( 8009): 	at android.support.v4.app.BackStackRecord.commitAllowingStateLoss(BackStackRecord.java:621)
01-14 00:09:03.808 I/MonoDroid( 8009): 	at md585057ebc46e14ad63423b345b13af9ee.MainActivity.n_onDestroy(Native Method)
01-14 00:09:03.808 I/MonoDroid( 8009): 	at md585057ebc46e14ad63423b345b13af9ee.MainActivity.onDestroy(MainActivity.java:56)
01-14 00:09:03.808 I/MonoDroid( 8009): 	at android.app.Activity.performDestroy(Activity.java:6567)
01-14 00:09:03.808 I/MonoDroid( 8009): 	at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1145)
01-14 00:09:03.808 I/MonoDroid( 8009): 	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3897)
01-14 00:09:03.808 I/MonoDroid( 8009): 	at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3929)
01-14 00:09:03.808 I/MonoDroid( 8009): 	at android.app.ActivityThread.access$1500(ActivityThread.java:168)
01-14 00:09:03.808 I/MonoDroid( 8009): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1433)
01-14 00:09:03.808 I/MonoDroid( 8009): 	at android.os.Handler.dispatchMessage(Handler.java:102)
01-14 00:09:03.808 I/MonoDroid( 8009): 	at android.os.Looper.loop(Looper.java:150)
01-14 00:09:03.808 I/MonoDroid( 8009): 	at android.app.ActivityThread.main(ActivityThread.java:5665)
01-14 00:09:03.808 I/MonoDroid( 8009): 	at java.lang.reflect.Method.invoke(Native Method)
01-14 00:09:03.808 I/MonoDroid( 8009): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:799)
01-14 00:09:03.808 I/MonoDroid( 8009): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:689)
Comment 11 Tiffany 2017-01-16 20:30:25 UTC
Issue is still occurring when on the main page of MasterDetail, when pressing on a hardware back button. Same trace as Mohammed.
Comment 12 Sylvain Gravel 2017-01-16 20:33:31 UTC
Was the fix integrated inside 2.3.4.184-pre1???
Comment 13 Mohamed 2017-01-16 20:39:49 UTC
According to the release notes, the fix is integrated in 2.3.4.184-pre1. The bug occurs on the main page of MasterDetailPage
Comment 14 Sylvain Gravel 2017-01-17 02:47:56 UTC
It looks as though the fix isn't merged in the release from your stack trace.  The fix is in FormsAppCompatActivity but your stack trace points to the version without it...

FormsAppCompatActivity.cs:195 should be a call to base.OnDestroy not Platform.Dispose

Someone from the Xamarin team would have to validate, the 2.3.4-pre1 version does work.
Comment 15 Samantha Houts 2017-01-17 17:52:43 UTC
Please try doing a clean and rebuild on your project. You may also need to make a small change to the visible UI to force Android to rebuild. If you are still experiencing the issue, please let us know.

Warm regards,
Xamarin.Forms Team
Comment 16 Mohamed 2017-01-17 19:24:49 UTC
After installing version 2.3.4.184-pre1, I did the clean and rebuild but the bug is still there.
Comment 17 Carlos Campos 2017-01-27 17:04:13 UTC
I was able to solve this by doing these steps:

- Clean the whole solution
- Delete the obj/bin folders
- Rebuild
- Test
- Profit

Please confirmed if you were able to solve it. Best regards
Comment 18 Gerard C 2017-02-28 13:30:14 UTC
Still occurring v2.3.4.192-pre2

Cleaned solution and deleted obj/bin folders

02-28 08:17:15.128: I/MonoDroid(9083): Java.Lang.IllegalStateException: Activity has been destroyed
02-28 08:17:15.128: I/MonoDroid(9083):   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <3dc9ed3d31194319991e686734adcb10>:0 
02-28 08:17:15.128: I/MonoDroid(9083):   at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method) [0x00084] in <a043032cf94a485190047a14918b9f60>:0 
02-28 08:17:15.128: I/MonoDroid(9083):   at Android.Runtime.JNIEnv.CallIntMethod (System.IntPtr jobject, System.IntPtr jmethod) [0x0000e] in <9eb16c47cc8f4aa6b6ac4abed5ff79de>:0 
02-28 08:17:15.128: I/MonoDroid(9083):   at Android.Support.V4.App.FragmentTransactionInvoker.CommitAllowingStateLoss () [0x00033] in <27c17fe440cf491ba8255bcefade6e02>:0 
02-28 08:17:15.128: I/MonoDroid(9083):   at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailContainer.Dispose (System.Boolean disposing) [0x00041] in <a3e44144fef249b0888b761605dfca24>:0 
02-28 08:17:15.128: I/MonoDroid(9083):   at Java.Lang.Object.Dispose () [0x00000] in <9eb16c47cc8f4aa6b6ac4abed5ff79de>:0 
02-28 08:17:15.128: I/MonoDroid(9083):   at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer.Dispose (System.Boolean disposing) [0x00046] in <a3e44144fef249b0888b761605dfca24>:0 
02-28 08:17:15.128: I/MonoDroid(9083):   at Java.Lang.Object.Dispose () [0x00000] in <9eb16c47cc8f4aa6b6ac4abed5ff79de>:0 
02-28 08:17:15.128: I/MonoDroid(9083):   at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x0003f] in <a3e44144fef249b0888b761605dfca24>:0 
02-28 08:17:15.128: I/MonoDroid(9083):   at Xamarin.Forms.Platform.Android.AppCompat.Platform.Dispose () [0x00010] in <a3e44144fef249b0888b761605dfca24>:0 
02-28 08:17:15.128: I/MonoDroid(9083):   at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy () [0x0002f] in <a3e44144fef249b0888b761605dfca24>:0 
02-28 08:17:15.128: I/MonoDroid(9083):   at Android.App.Activity.n_OnDestroy (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <9eb16c47cc8f4aa6b6ac4abed5ff79de>:0 
02-28 08:17:15.128: I/MonoDroid(9083):   at (wrapper dynamic-method) System.Object:5c8aedae-617c-4cdc-9cdd-feeb13ea3f26 (intptr,intptr)
02-28 08:17:15.128: I/MonoDroid(9083):   --- End of managed Java.Lang.IllegalStateException stack trace ---
02-28 08:17:15.128: I/MonoDroid(9083): java.lang.IllegalStateException: Activity has been destroyed
02-28 08:17:15.129: I/MonoDroid(9083): 	at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1515)
02-28 08:17:15.129: I/MonoDroid(9083): 	at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:638)
02-28 08:17:15.129: I/MonoDroid(9083): 	at android.support.v4.app.BackStackRecord.commitAllowingStateLoss(BackStackRecord.java:621)
02-28 08:17:15.129: I/MonoDroid(9083): 	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.n_onDestroy(Native Method)
02-28 08:17:15.129: I/MonoDroid(9083): 	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.onDestroy(FormsAppCompatActivity.java:80)
02-28 08:17:15.129: I/MonoDroid(9083): 	at android.app.Activity.performDestroy(Activity.java:6407)
02-28 08:17:15.129: I/MonoDroid(9083): 	at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1142)
02-28 08:17:15.129: I/MonoDroid(9083): 	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3818)
02-28 08:17:15.129: I/MonoDroid(9083): 	at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3849)
02-28 08:17:15.129: I/MonoDroid(9083): 	at android.app.ActivityThread.-wrap5(ActivityThread.java)
02-28 08:17:15.129: I/MonoDroid(9083): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1398)
02-28 08:17:15.129: I/MonoDroid(9083): 	at android.os.Handler.dispatchMessage(Handler.java:102)
02-28 08:17:15.129: I/MonoDroid(9083): 	at android.os.Looper.loop(Looper.java:148)
02-28 08:17:15.129: I/MonoDroid(9083): 	at android.app.ActivityThread.main(ActivityThread.java:5417)
02-28 08:17:15.129: I/MonoDroid(9083): 	at java.lang.reflect.Method.invoke(Native Method)
02-28 08:17:15.129: I/MonoDroid(9083): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
02-28 08:17:15.129: I/MonoDroid(9083): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Comment 19 Gerard C 2017-02-28 14:09:06 UTC
Just tracked my issue to my splash screen implementation.  Fixed my issue by recreating splash screen following: 

https://developer.xamarin.com/guides/android/user_interface/creating_a_splash_screen/
Comment 20 Nikolai Doronin 2017-03-03 11:27:12 UTC
Xamarin team, can the fix be backported to 2.3.3 version? Bug 45330 was backported - it's reasonable, developers really need a truly stable release.

Unfortunately, 2.3.4 is not usable at the moment due to Bug 52533.
Comment 21 Toby 2017-03-16 11:55:35 UTC
I have just updated to the latest available stable (version 2.3.3.193) and this issue still occurs on Android device with a MasterDetail Page configuration.

03-16 11:47:05.320 I/MonoDroid(10401): UNHANDLED EXCEPTION:
03-16 11:47:05.418 I/MonoDroid(10401): Java.Lang.IllegalStateException: Activity has been destroyed
03-16 11:47:05.418 I/MonoDroid(10401):   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/4009/3a62f1ea/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
03-16 11:47:05.418 I/MonoDroid(10401):   at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method) [0x00084] in /Users/builder/data/lanes/4009/3a62f1ea/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:11464 
03-16 11:47:05.418 I/MonoDroid(10401):   at Android.Runtime.JNIEnv.CallIntMethod (System.IntPtr jobject, System.IntPtr jmethod) [0x00000] in /Users/builder/data/lanes/4009/3a62f1ea/source/monodroid/src/Mono.Android/JNIEnv.g.cs:186 
03-16 11:47:05.418 I/MonoDroid(10401):   at Android.Support.V4.App.FragmentTransactionInvoker.CommitAllowingStateLoss () [0x00033] in <27c17fe440cf491ba8255bcefade6e02>:0 
03-16 11:47:05.418 I/MonoDroid(10401):   at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailContainer.Dispose (System.Boolean disposing) [0x00042] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\MasterDetailContainer.cs:130 
03-16 11:47:05.418 I/MonoDroid(10401):   at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/4009/3a62f1ea/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203 
03-16 11:47:05.419 I/MonoDroid(10401):   at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer.Dispose (System.Boolean disposing) [0x00046] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\MasterDetailPageRenderer.cs:192 
03-16 11:47:05.419 I/MonoDroid(10401):   at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/4009/3a62f1ea/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203 
03-16 11:47:05.419 I/MonoDroid(10401):   at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x0003f] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:226 
03-16 11:47:05.419 I/MonoDroid(10401):   at Xamarin.Forms.Platform.Android.AppCompat.Platform.Dispose () [0x00010] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:52 
03-16 11:47:05.419 I/MonoDroid(10401):   at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy () [0x0002f] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:195 
03-16 11:47:05.419 I/MonoDroid(10401):   at Android.App.Activity.n_OnDestroy (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in /Users/builder/data/lanes/4009/3a62f1ea/source/monodroid/src/Mono.Android/platforms/android-25/src/generated/Android.App.Activity.cs:2981 
03-16 11:47:05.419 I/MonoDroid(10401):   at (wrapper dynamic-method) System.Object:36250a17-2bcd-41ca-9a25-f38a2744bdb5 (intptr,intptr)
03-16 11:47:05.419 I/MonoDroid(10401):   --- End of managed Java.Lang.IllegalStateException stack trace ---
03-16 11:47:05.419 I/MonoDroid(10401): java.lang.IllegalStateException: Activity has been destroyed
03-16 11:47:05.419 I/MonoDroid(10401): 	at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1515)
03-16 11:47:05.419 I/MonoDroid(10401): 	at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:638)
03-16 11:47:05.419 I/MonoDroid(10401): 	at android.support.v4.app.BackStackRecord.commitAllowingStateLoss(BackStackRecord.java:621)
03-16 11:47:05.419 I/MonoDroid(10401): 	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.n_onDestroy(Native Method)
03-16 11:47:05.419 I/MonoDroid(10401): 	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.onDestroy(FormsAppCompatActivity.java:80)
03-16 11:47:05.419 I/MonoDroid(10401): 	at android.app.Activity.performDestroy(Activity.java:6907)
03-16 11:47:05.419 I/MonoDroid(10401): 	at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1154)
03-16 11:47:05.419 I/MonoDroid(10401): 	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4267)
03-16 11:47:05.419 I/MonoDroid(10401): 	at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4298)
03-16 11:47:05.419 I/MonoDroid(10401): 	at android.app.ActivityThread.-wrap6(ActivityThread.java)
03-16 11:47:05.419 I/MonoDroid(10401): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1576)
03-16 11:47:05.419 I/MonoDroid(10401): 	at android.os.Handler.dispatchMessage(Handler.java:102)
03-16 11:47:05.419 I/MonoDroid(10401): 	at android.os.Looper.loop(Looper.java:241)
03-16 11:47:05.419 I/MonoDroid(10401): 	at android.app.ActivityThread.main(ActivityThread.java:6217)
03-16 11:47:05.419 I/MonoDroid(10401): 	at java.lang.reflect.Method.invoke(Native Method)
03-16 11:47:05.419 I/MonoDroid(10401): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
03-16 11:47:05.419 I/MonoDroid(10401): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
03-16 11:47:05.419 I/MonoDroid(10401): 
03-16 11:47:05.430 D/Mono    (10401): DllImport searching in: '__Internal' ('(null)').
03-16 11:47:05.430 D/Mono    (10401): Searching for 'java_interop_jnienv_throw'.
03-16 11:47:05.430 D/Mono    (10401): Probing 'java_interop_jnienv_throw'.
03-16 11:47:05.430 D/Mono    (10401): Found as 'java_interop_jnienv_throw'.
An unhandled exception occured.

03-16 11:47:05.877 E/mono    (10401): 
03-16 11:47:05.877 E/mono    (10401): Unhandled Exception:
03-16 11:47:05.877 E/mono    (10401): Java.Lang.IllegalStateException: Activity has been destroyed
03-16 11:47:05.877 E/mono    (10401):   --- End of managed Java.Lang.IllegalStateException stack trace ---
03-16 11:47:05.877 E/mono    (10401): java.lang.IllegalStateException: Activity has been destroyed
03-16 11:47:05.877 E/mono    (10401): 	at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1515)
03-16 11:47:05.877 E/mono    (10401): 	at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:638)
03-16 11:47:05.877 E/mono    (10401): 	at android.support.v4.app.BackStackRecord.commitAllowingStateLoss(BackStackRecord.java:621)
03-16 11:47:05.877 E/mono    (10401): 	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.n_onDestroy(Native Method)
03-16 11:47:05.877 E/mono    (10401): 	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.onDestroy(FormsAppCompatActivity.java:80)
03-16 11:47:05.877 E/mono    (10401): 	at android.app.Activity.performDestroy(Activity.java:6907)
03-16 11:47:05.877 E/mono    (10401): 	at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1154)
03-16 11:47:05.877 E/mono    (10401): 	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4267)
03-16 11:47:05.877 E/mono    (10401): 	at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4298)
03-16 11:47:05.877 E/mono    (10401): 	at android.app.ActivityThread.-wrap6(ActivityThread.java)
03-16 11:47:05.877 E/mono    (10401): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1576)
03-16 11:47:05.877 E/mono    (10401): 	at android.os.Handler.dispatchMessage(Handler.java:102)
03-16 11:47:05.877 E/mono    (10401): 	at android.os.Looper.loop(Looper.java:241)
03-16 11:47:05.877 E/mono    (10401): 	at android.app.ActivityThread.main(ActivityThread.java:6217)
03-16 11:47:05.877 E/mono    (10401): 	at java.lang.reflect.Method.invoke(Native Method)
03-16 11:47:05.877 E/mono    (10401): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
03-16 11:47:05.877 E/mono    (10401): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
03-16 11:47:05.877 E/mono    (10401): 
03-16 11:47:05.878 E/mono-rt (10401): [ERROR] FATAL UNHANDLED EXCEPTION: Java.Lang.IllegalStateException: Activity has been destroyed
03-16 11:47:05.878 E/mono-rt (10401):   --- End of managed Java.Lang.IllegalStateException stack trace ---
03-16 11:47:05.878 E/mono-rt (10401): java.lang.IllegalStateException: Activity has been destroyed
03-16 11:47:05.878 E/mono-rt (10401): 	at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1515)
03-16 11:47:05.878 E/mono-rt (10401): 	at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:638)
03-16 11:47:05.878 E/mono-rt (10401): 	at android.support.v4.app.BackStackRecord.commitAllowingStateLoss(BackStackRecord.java:621)
03-16 11:47:05.878 E/mono-rt (10401): 	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.n_onDestroy(Native Method)
03-16 11:47:05.878 E/mono-rt (10401): 	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.onDestroy(FormsAppCompatActivity.java:80)
03-16 11:47:05.878 E/mono-rt (10401): 	at android.app.Activity.performDestroy(Activity.java:6907)
03-16 11:47:05.878 E/mono-rt (10401): 	at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1154)
03-16 11:47:05.878 E/mono-rt (10401): 	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4267)
03-16 11:47:05.878 E/mono-rt (10401): 	at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4298)
03-16 11:47:05.878 E/mono-rt (10401): 	at android.app.ActivityThread.-wrap6(ActivityThread.java)
03-16 11:47:05.878 E/mono-rt (10401): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1576)
03-16 11:47:05.878 E/mono-rt (10401): 	at android.os.Handler.dispatchMessage(Handler.java:102)
03-16 11:47:05.878 E/mono-rt (10401): 	at android.os.Looper.loop(Looper.java:241)
03-16 11:47:05.878 E/mono-rt (10401): 	at android.app.ActivityThread.main(ActivityThread.java:6217)
03-16 11:47:05.878 E/mono-rt (10401): 	at java.lang.reflect.Method.invoke(Native Method)
03-16 11:47:05.878 E/mono-rt (10401): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
03-16 11:47:05.878 E/mono-rt (10401): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
03-16 11:47:05.878 E/mono-rt (10401):
Comment 22 Samantha Houts 2017-03-16 18:58:06 UTC
@Toby: The fix is in the latest prerelease (2.3.4).

 @Nikolai Doronin: Please try the latest prerelease of 2.3.4; Bug 52533 is now resolved.

Thank you!
Comment 23 Jimmy 2017-03-22 23:00:57 UTC
*** Bug 53702 has been marked as a duplicate of this bug. ***
Comment 24 joshua 2017-03-28 05:33:39 UTC
This bug is still present in the latest Xamarin.Forms 2.3.4.221-pre6 version.

And I can't get my apps into production because of this bug, guys come on! This must be the top priority for you.

Here is the stack trace:


 	0xFFFFFFFFFFFFFFFF in System.Diagnostics.Debugger.Mono_UnhandledException_internal	C#
 	0x1 in System.Diagnostics.Debugger.Mono_UnhandledException at /Users/builder/data/lanes/4009/f3074d2c/source/mono/mcs/class/corlib/System.Diagnostics/Debugger.cs:122,4	C#
 	0x20 in object.cb54310b-a67d-495a-9e94-290705f2c695	C#
 	0x12 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw at /Users/builder/data/lanes/4009/f3074d2c/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143,13	C#
 	0x84 in Java.Interop.JniEnvironment.InstanceMethods.CallIntMethod at /Users/builder/data/lanes/4009/9578cdcd/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:11464,41	C#
 	0xE in Android.Runtime.JNIEnv.CallIntMethod at /Users/builder/data/lanes/4009/9578cdcd/source/monodroid/src/Mono.Android/JNIEnv.g.cs:186,4	C#
 	0x38 in Android.Support.V4.App.FragmentTransactionInvoker.CommitAllowingStateLoss	C#
 	0x42 in Xamarin.Forms.Platform.Android.AppCompat.MasterDetailContainer.Dispose at C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\MasterDetailContainer.cs:130,6	C#
 	0x2 in Java.Lang.Object.Dispose at /Users/builder/data/lanes/4009/9578cdcd/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203,4	C#
 	0x4C in Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer.Dispose at C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\MasterDetailPageRenderer.cs:192,6	C#
 	0x2 in Java.Lang.Object.Dispose at /Users/builder/data/lanes/4009/9578cdcd/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203,4	C#
 	0x3F in Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage at C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:226,6	C#
 	0x12 in Xamarin.Forms.Platform.Android.AppCompat.Platform.Dispose at C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:52,4	C#
 	0x35 in Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy at C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:195,5	C#
 	0xA in Android.App.Activity.n_OnDestroy at /Users/builder/data/lanes/4009/9578cdcd/source/monodroid/src/Mono.Android/platforms/android-25/src/generated/Android.App.Activity.cs:2981,4	C#
 	0x11 in object.cb54310b-a67d-495a-9e94-290705f2c695	C#
Comment 25 Esam Sherif 2017-03-29 18:00:47 UTC
I've set the Detail property to Page not NavigationPage it didn't throw exception but i don't have navigation bar.

Detail = 
        new ContentPage()
        {
        // ...
        }

This is a workaround till the bug gets fixed.
Comment 26 Marek Mierzwa 2017-06-08 14:09:22 UTC
I'm not sure that this is completely fixed. I've just saw the same error in current version of Xamarin.Forms - 2.3.4.247 - in my app:

Package: ...
Version Code: 4944
Version Name: 1.3.0.4944
Android: 5.0.1
Android Build: LRX22C.I9515XXS1BPL2
Manufacturer: samsung
Model: GT-I9515
Thread: main-1
CrashReporter Key: C1E426D7-15AD-6A13-CE0A-CC76FEE00AA3132F40E1
Start Date: Thu Jun 08 15:55:13 GMT+02:00 2017
Date: Thu Jun 08 15:59:03 GMT+02:00 2017
Format: Xamarin

Xamarin caused by: android.runtime.JavaProxyThrowable: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Java.Lang.RuntimeException: Activity has been destroyed
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <581fd1ce1461412e9a64234d21e01d68>:0 
  at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method) [0x00084] in <b75574a81e944fd08d31a296e8e3305d>:0 
  at Android.Runtime.JNIEnv.CallIntMethod (System.IntPtr jobject, System.IntPtr jmethod) [0x0000e] in <34b018740607449a9f9a8aca8f08247b>:0 
  at Android.Support.V4.App.FragmentTransactionInvoker.CommitAllowingStateLoss () [0x00033] in <27c17fe440cf491ba8255bcefade6e02>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.SwitchContentAsync (Xamarin.Forms.Page page, System.Boolean animated, System.Boolean removed, System.Boolean popToRoot) [0x0017e] in <1481f85a917c4f2b882ea161e9bc082f>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.OnPushAsync (Xamarin.Forms.Page view, System.Boolean animated) [0x00000] in <1481f85a917c4f2b882ea161e9bc082f>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.PushViewAsync (Xamarin.Forms.Page page, System.Boolean animated) [0x00000] in <1481f85a917c4f2b882ea161e9bc082f>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1[TElement] e) [0x0018e] in <1481f85a917c4f2b882ea161e9bc082f>:0 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000fc] in <1481f85a917c4f2b882ea161e9bc082f>:0 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in <1481f85a917c4f2b882ea161e9bc082f>:0 
  at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0001f] in <1481f85a917c4f2b882ea161e9bc082f>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.Platform.AddChild (Xamarin.Forms.Page page, System.Boolean layout) [0x00015] in <1481f85a917c4f2b882ea161e9bc082f>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x00090] in <1481f85a917c4f2b882ea161e9bc082f>:0 
  at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.InternalSetPage (Xamarin.Forms.Page page) [0x0001a] in <1481f85a917c4f2b882ea161e9bc082f>:0 
  at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.AppOnPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs args) [0x0001e] in <1481f85a917c4f2b882ea161e9bc082f>:0 
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00012] in <0f1ce60dbc6b4e24af01294c7acf41c6>:0 
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in <0f1ce60dbc6b4e24af01294c7acf41c6>:0 
  at Xamarin.Forms.Application.set_MainPage (Xamarin.Forms.Page value) [0x0008b] in <0f1ce60dbc6b4e24af01294c7acf41c6>:0 
  at MyMd.Mobile.Core.PageModels.LoginPageModel.ShowAppPage () [0x00032] in <65115cc10502453a804fa4c43dc3a1d2>:0 
  at MyMd.Mobile.Core.PageModels.LoginPageModel.OnNavigated (MyMd.Mobile.Core.Pages.LoginPage page, MyMd.Mobile.Core.Views.CookieNavigatedEventArgs eventArgs) [0x0007d] in <65115cc10502453a804fa4c43dc3a1d2>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <581fd1ce1461412e9a64234d21e01d68>:0 
   --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00056] in <581fd1ce1461412e9a64234d21e01d68>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <581fd1ce1461412e9a64234d21e01d68>:0 
  at Xamarin.Forms.MessagingCenter+Subscription.InvokeCallback (System.Object sender, System.Object args) [0x00076] in <0f1ce60dbc6b4e24af01294c7acf41c6>:0 
  at Xamarin.Forms.MessagingCenter.InnerSend (System.String message, System.Type senderType, System.Type argType, System.Object sender, System.Object args) [0x00069] in <0f1ce60dbc6b4e24af01294c7acf41c6>:0 
  at Xamarin.Forms.MessagingCenter.Send[TSender,TArgs] (TSender sender, System.String message, TArgs args) [0x00013] in <0f1ce60dbc6b4e24af01294c7acf41c6>:0 
  at MyMd.Mobile.Core.Pages.LoginPage.ServiceWebView_OnNavigated (System.Object sender, MyMd.Mobile.Core.Views.CookieNavigatedEventArgs args) [0x00000] in <65115cc10502453a804fa4c43dc3a1d2>:0 
  at MyMd.Mobile.Core.Views.CookieWebView.OnNavigated (MyMd.Mobile.Core.Views.CookieNavigatedEventArgs args) [0x0000d] in <65115cc10502453a804fa4c43dc3a1d2>:0 
  at MyMd.Mobile.Droid.Renderers.CookieWebViewClient.OnPageFinished (Android.Webkit.WebView view, System.String url) [0x0007e] in <3c5cfdb90a8e42d0a988a703f14fc2b5>:0 
  at Android.Webkit.WebViewClient.n_OnPageFinished_Landroid_webkit_WebView_Ljava_lang_String_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_view, System.IntPtr native_url) [0x00019] in <34b018740607449a9f9a8aca8f08247b>:0 
  at (wrapper dynamic-method) System.Object:c9f527e7-db54-43c6-ab98-413993aa1ebd (intptr,intptr,intptr,intptr)
	at md5af2ff16caad23ac3babe8f19424b03f2.CookieWebViewClient.n_onPageFinished(Native Method)
	at md5af2ff16caad23ac3babe8f19424b03f2.CookieWebViewClient.onPageFinished(CookieWebViewClient.java:40)
	at com.android.webview.chromium.WebViewContentsClientAdapter.onPageFinished(WebViewContentsClientAdapter.java:545)
	at org.chromium.android_webview.AwContentsClientCallbackHelper$MyHandler.handleMessage(AwContentsClientCallbackHelper.java:201)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:145)
	at android.app.ActivityThread.main(ActivityThread.java:5951)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
Comment 27 Aleksandrs Vorobjovs 2017-07-19 06:53:25 UTC
samantha.houts@xamarin.com
jimmy.garrido@xamarin.com

It seems that this bug is not fixed. We have the same error with the current version of Xamarin.Forms 2.3.4.247.
Unfortunately, I cannot reproduce this error, but it happens from time to time in our users.


Java.Lang.RuntimeException: Unable to destroy activity {com.mobility/md588a80bc88619ccb558039bed58ec6fda.MainActivity}: 
java.lang.IllegalStateException: Activity has been destroyed ---> 
Java.Lang.RuntimeException: Activity has been destroyed
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <79f625294f864b059bf044d42d48b8ca>:0 
  at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method) [0x00084] in <3539a7746c044550b128737eb1e6d640>:0 
  at Android.Runtime.JNIEnv.CallIntMethod (System.IntPtr jobject, System.IntPtr jmethod) [0x0000e] in <ad0a12d492564b9987fc83651adbac1a>:0 
  at Android.Support.V4.App.FragmentTransactionInvoker.CommitAllowingStateLoss () [0x00033] in <27c17fe440cf491ba8255bcefade6e02>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailContainer.Dispose (System.Boolean disposing) [0x00041] in <556464d784854d58957ce21f4c5eb182>:0 
  at Java.Lang.Object.Dispose () [0x00000] in <ad0a12d492564b9987fc83651adbac1a>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer.Dispose (System.Boolean disposing) [0x00046] in <556464d784854d58957ce21f4c5eb182>:0 
  at Java.Lang.Object.Dispose () [0x00000] in <ad0a12d492564b9987fc83651adbac1a>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x0003f] in <556464d784854d58957ce21f4c5eb182>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.Platform.Dispose () [0x00010] in <556464d784854d58957ce21f4c5eb182>:0 
  at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy () [0x0002f] in <556464d784854d58957ce21f4c5eb182>:0 
  at Android.App.Activity.n_OnDestroy (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <ad0a12d492564b9987fc83651adbac1a>:0 
  at (wrapper dynamic-method) System.Object:4112649e-3675-4850-b0d8-a1e989b27378 (intptr,intptr)
   --- End of inner exception stack trace ---
  --- End of managed Java.Lang.RuntimeException stack trace ---
java.lang.RuntimeException: Unable to destroy activity {com.mobility/md588a80bc88619ccb558039bed58ec6fda.MainActivity}: 
java.lang.IllegalStateException: Activity has been destroyed
	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4398)
	at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4417)
	at android.app.ActivityThread.-wrap6(ActivityThread.java)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1629)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:156)
	at android.app.ActivityThread.main(ActivityThread.java:6524)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
Caused by: java.lang.IllegalStateException: Activity has been destroyed
	at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1515)
	at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:638)
	at android.support.v4.app.BackStackRecord.commitAllowingStateLoss(BackStackRecord.java:621)
	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.n_onDestroy(Native Method)
	at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.onDestroy(FormsAppCompatActivity.java:80)
	at android.app.Activity.performDestroy(Activity.java:7136)
	at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1158)
	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4385)
	... 9 more

Note You need to log in before you can comment on or make changes to this bug.