Regarding to the MasterDetailPage "An unhandled exception occured" shown after app closed.

ShawnGOShawnGO TWMember ✭✭

I created a Xamarin.Form PCL project, and manually added a MasterDetailPage template( it included a Mainpage, MasterPage and DetailPage, but appears namespace already exists error, I solved it by rename the namespace name for each generated page), so I run the app on my Android device, it runs correctly, but the problem is that every time I close the app, an exception "An unhandled exception occured" throws, annoying me...

Can anybody help?

The detailed information shown as the following:
D/Mono (24447): DllImport attempting to load: '/system/lib/liblog.so'.
03-25 19:31:03.801 D/Mono (24447): DllImport loaded library '/system/lib/liblog.so'.
03-25 19:31:03.801 D/Mono (24447): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
03-25 19:31:03.801 D/Mono (24447): Searching for '__android_log_print'.
03-25 19:31:03.801 D/Mono (24447): Probing '__android_log_print'.
03-25 19:31:03.801 D/Mono (24447): Found as '__android_log_print'.
03-25 19:31:03.801 I/MonoDroid(24447): UNHANDLED EXCEPTION:
03-25 19:31:03.871 I/MonoDroid(24447): Java.Lang.IllegalStateException: Activity has been destroyed
03-25 19:31:03.871 I/MonoDroid(24447): 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-25 19:31:03.871 I/MonoDroid(24447): 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-25 19:31:03.871 I/MonoDroid(24447): 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-25 19:31:03.871 I/MonoDroid(24447): at Android.Support.V4.App.FragmentTransactionInvoker.CommitAllowingStateLoss () [0x00033] in <27c17fe440cf491ba8255bcefade6e02>:0
03-25 19:31:03.871 I/MonoDroid(24447): 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-25 19:31:03.871 I/MonoDroid(24447): 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-25 19:31:03.871 I/MonoDroid(24447): 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-25 19:31:03.871 I/MonoDroid(24447): 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-25 19:31:03.871 I/MonoDroid(24447): 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-25 19:31:03.871 I/MonoDroid(24447): at Xamarin.Forms.Platform.Android.AppCompat.Platform.Dispose () [0x00010] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:52
03-25 19:31:03.871 I/MonoDroid(24447): at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy () [0x0002f] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:195
03-25 19:31:03.871 I/MonoDroid(24447): 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-23/src/generated/Android.App.Activity.cs:2857
03-25 19:31:03.871 I/MonoDroid(24447): at (wrapper dynamic-method) System.Object:37f0adbe-4a2d-4cdf-8790-12ff8b193d36 (intptr,intptr)
03-25 19:31:03.871 I/MonoDroid(24447): --- End of managed Java.Lang.IllegalStateException stack trace ---
03-25 19:31:03.871 I/MonoDroid(24447): java.lang.IllegalStateException: Activity has been destroyed
03-25 19:31:03.871 I/MonoDroid(24447): at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1515)
03-25 19:31:03.871 I/MonoDroid(24447): at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:638)
03-25 19:31:03.871 I/MonoDroid(24447): at android.support.v4.app.BackStackRecord.commitAllowingStateLoss(BackStackRecord.java:621)
03-25 19:31:03.871 I/MonoDroid(24447): at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.n_onDestroy(Native Method)
03-25 19:31:03.871 I/MonoDroid(24447): at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.onDestroy(FormsAppCompatActivity.java:80)
03-25 19:31:03.871 I/MonoDroid(24447): at android.app.Activity.performDestroy(Activity.java:7102)
03-25 19:31:03.871 I/MonoDroid(24447): at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1170)
03-25 19:31:03.871 I/MonoDroid(24447): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5052)
03-25 19:31:03.871 I/MonoDroid(24447): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5097)
03-25 19:31:03.871 I/MonoDroid(24447): at android.app.ActivityThread.access$1700(ActivityThread.java:222)
03-25 19:31:03.871 I/MonoDroid(24447): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1854)
03-25 19:31:03.871 I/MonoDroid(24447): at android.os.Handler.dispatchMessage(Handler.java:102)
03-25 19:31:03.871 I/MonoDroid(24447): at android.os.Looper.loop(Looper.java:158)
03-25 19:31:03.871 I/MonoDroid(24447): at android.app.ActivityThread.main(ActivityThread.java:7237)
03-25 19:31:03.871 I/MonoDroid(24447): at java.lang.reflect.Method.invoke(Native Method)
03-25 19:31:03.871 I/MonoDroid(24447): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
03-25 19:31:03.871 I/MonoDroid(24447): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
03-25 19:31:03.881 D/Mono (24447): DllImport searching in: '__Internal' ('(null)').
03-25 19:31:03.881 D/Mono (24447): Searching for 'java_interop_jnienv_throw'.
03-25 19:31:03.881 D/Mono (24447): Probing 'java_interop_jnienv_throw'.
03-25 19:31:03.881 D/Mono (24447): Found as 'java_interop_jnienv_throw'.
An unhandled exception occured.

Best Answer

Answers

  • YoreJinYoreJin USMember

    I meet the same problem like above. And if click 'back' button on 'MasterDetailPage' ,it occurs too

  • ShawnGOShawnGO TWMember ✭✭

    Felipe Junges
    It does solve my problem, but I think there must be something wrong with the MasterDetail Page so the app crashed before it is being released.

    But anyway, thanks! It solved.

  • TimSTimS DEMember ✭✭

    I'm facing the same issue after the update. But I've a tabbed page, which includes a navigation page for each tab. Any ideas when this issue will be fixed?

  • ShawnGOShawnGO TWMember ✭✭

    You can create pages manually. It should work.

Sign In or Register to comment.