This bug affects Xamarin.Forms.126.96.36.199-pre3. Xamarin.Forms.188.8.131.52-pre2 and prior are not affected.
Using the sample XF app I am setting MainPage to new NavigationPage(new XamarinTestPage()) and on XamarinTestPage I have a button that Navigation.PushAsync(new ContentPage());
When you use the back button on the ContentPage to return to the XamarinTestPage the following exception is thrown.
*** Terminating app due to uncaught exception 'System.AggregateException', reason: 'System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> System.NotSupportedException: Popped page does not appear on top of current navigation stack, please file a bug. at Xamarin.Forms.Platform.iOS.NavigationRenderer+<OnPopViewAsync>d__41.MoveNext () [0x0005e] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.iOS\Renderers\NavigationRenderer.cs:291 --- End of inner exception stack trace --- ---> (Inner Exception #0) System.NotSupportedException: Popped page does not appear on top of current navigation stack, please file a bug. at Xamarin.Forms.Platform.iOS.NavigationRenderer+<OnPopViewAsync>d__41.MoveNext () [0x0005e] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.iOS\Renderers\NavigationRenderer.cs:291 <--- '
Please note that this exception is only visible when some sort of crash logging like HockeyApp or Crashlytics is included. When these are included the app terminates immediately with the following stack trace.
Thread 5 Crashed:: Finalizer
0 libsystem_kernel.dylib 0x0c8fc49a __pthread_kill + 10
1 libsystem_pthread.dylib 0x0c92dec3 pthread_kill + 90
2 libsystem_c.dylib 0x0c68f11f abort + 141
3 com.sisailmahuolto.tyomaarain 0x000a2b45 uncaught_exception_handler + 38
4 com.apple.CoreFoundation 0x0aa60269 __handleUncaughtException + 809
5 libobjc.A.dylib 0x0b477103 _objc_terminate() + 100
6 com.sisailmahuolto.tyomaarain 0x00086574 BITCrashUncaughtCXXTerminateHandler() + 867 (BITCrashCXXExceptionHandler.mm:181)
7 libc++abi.dylib 0x0b45f6c1 std::__terminate(void (*)()) + 14
8 libc++abi.dylib 0x0b45f0e3 __cxa_throw + 122
9 libobjc.A.dylib 0x0b476f83 objc_exception_throw + 337
10 libxamarin-debug.dylib 0x0b23c8fb xamarin_process_nsexception_using_mode + 315
11 libxamarin-debug.dylib 0x0b23c7b4 xamarin_process_nsexception + 36
12 libxamarin-debug.dylib 0x0b24a075 xamarin_dyn_objc_msgSend + 149
13 ??? 0x22a2fb60 0 + 581106528
14 ??? 0x22a2bd78 0 + 581090680
15 ??? 0x22a2ba3c 0 + 581089852
16 ??? 0x22a2b978 0 + 581089656
17 ??? 0x22a2b8b5 0 + 581089461
18 ??? 0x22a2acb8 0 + 581086392
19 ??? 0x22717455 0 + 577860693
20 libmonosgen-2.0.dylib 0x0afa1e54 mono_gc_run_finalize + 1092
21 libmonosgen-2.0.dylib 0x0afdece9 sgen_client_run_finalize + 25
22 libmonosgen-2.0.dylib 0x0afee7d4 sgen_gc_invoke_finalizers + 292
23 libmonosgen-2.0.dylib 0x0afa3235 finalizer_thread + 597
24 libmonosgen-2.0.dylib 0x0af7b6af start_wrapper + 575
25 libmonosgen-2.0.dylib 0x0b04370a inner_start_thread + 458
26 libsystem_pthread.dylib 0x0c92b10b _pthread_body + 184
27 libsystem_pthread.dylib 0x0c92b053 _pthread_start + 243
28 libsystem_pthread.dylib 0x0c92a92e thread_start + 34
If bug reporting packages aren't included this bug happens in the background silently. It really needs to be fixed when bug reporters are present however, it could end up leading to something more sinister.
What happens when you add a Exception Catchpoint (On System.Exception) without including "crash logging like HockeyApp or Crashlytics".
In one of my projects, it breaks on the Exception, but doesn't crash if I continue. With HockeyApp 'on' it does crash after catching the Exception.
+1 here, the same stack trace.
Oh, I was so excited about pre-4 because of fix https://bugzilla.xamarin.com/show_bug.cgi?id=44338 in there. Now I have to choose - either context actions crash or broken navigation.
After some research I figured out that exception occurs even in pre-2 in my case. Only stable 184.108.40.206 works fine.
Really hope this will be fixed soon.
Should be fixed in 2.3.3 stable. Thank you!
*** Bug 44560 has been marked as a duplicate of this bug. ***
This seems to have raised its ugly head again in version 220.127.116.11. I commented out the HockeyApp initialization code in AppDelegate.cs and the application will navigate again without error...re-establish the code, and it fails with the above System.AggregateException.
Actually, I take that back...I updated from HockeyApp.iOS 18.104.22.168 to the most recent HockeySDK.Xamarin in NuGet, 4.1.1, and it fixed the issue. Carry on...nothing to see here.
I have the same error. Updating HockeySDK to the latest version didn't change anything...
@Stefanica Are you using 2.3.3 stable?