Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

NavigationPage exception not caught, crashes when using HockeyApp

$
0
0

I'm unable to find an exact similar issue on here (or on Bugzilla), so I thought I'd ask here, to see if anyone has any idea of what's happening.

Essentially, I have a simple Xamarin.Forms project with iOS and Android targets.

My main page is a NavigationPage, but as soon as I push a page on top of this (it can be an empty ContentPage), then pop it, the app crashes with no output.

It's important to note that this ONLY happens on iOS, and ONLY when a crash handler is installed (tried with HockeyApp and Crashlytics so far).

With or without a crash handler, Xamarin is not catching this exception, so it almost feels like there's nothing wrong with the project, until I enable HockeyApp.

I'm unable to replicate this with a brand new, empty Xamarin.Forms project, so it does seem to be project specific, but I have no idea where to start looking at.

Here's my App.cs initialization:

public App()
{
    MainPage = new NavigationPage(new CalendarPage());
}

CalendarPage.cs has a button that pushes the next view:

private async void Handle_Clicked(object sender, System.EventArgs e)
{
    if (sender == KohdeButton || sender == KohdeToolbarItem)
    {
        await Navigation.PushAsync(new DestinationListPage());
    }
}

At this point, it doesn't matter if I use await Navigation.PushAsync(new ContentPage());, the crash will still be there.

I'm assuming I'm initializing App.cs correctly, unless I should be subclassing NavigationPage as CalendarPage?

At any rate, I'm not doing any manual pushing/popping, apart from the above, and using the built-in back button functionality.

Here are the crash details:

*** 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 <---

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>