Bug 39292 - System.InvalidOperationException: PopToRootAsync ( or PushAsync) is not supported globally on Android, please use a NavigationPage.
Summary: System.InvalidOperationException: PopToRootAsync ( or PushAsync) is not suppo...
Status: RESOLVED INVALID
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.0.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL: https://forums.xamarin.com/discussion...
Depends on:
Blocks:
 
Reported: 2016-03-02 09:00 UTC by Vaikesh
Modified: 2016-03-10 19:38 UTC (History)
4 users (show)

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


Attachments
Sample App with exception. (195.81 KB, application/zip)
2016-03-02 09:00 UTC, Vaikesh
Details


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:
Status:
RESOLVED INVALID

Description Vaikesh 2016-03-02 09:00:45 UTC
Created attachment 15219 [details]
Sample App with exception.

System.InvalidOperationException: PopToRootAsync ( or PushAsync) is not supported globally on Android, please use a NavigationPage



Steps to replicate exception
******************************
1. Exception 1 :

 - Presents a page (PushModalAsync) modally from HomePage.
 - Click a button to navigate to root (PopToRootAsync)
 ---- results in Exception : System.InvalidOperationException: PopToRootAsync is not supported globally on Android, please use a NavigationPage.

2. Exception 2 :

 - Presents a page (PushModalAsync) modally from HomePage.
 - BackButton press evevnt is overridden to push a page.
---- results in Exception : System.InvalidOperationException: PushAsync is not supported globally on Android, please use a NavigationPage.

===================================================================================================================

Details :

Microsoft Visual Studio Enterprise 2015
Version 14.0.23107.0 D14REL
Microsoft .NET Framework
Version 4.6.00081

Installed Version: Enterprise

Architecture and Modeling Tools   00322-80000-00000-AA852
Microsoft Architecture and Modeling Tools
    
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

Visual Basic 2015   00322-80000-00000-AA852
Microsoft Visual Basic 2015

Visual C# 2015   00322-80000-00000-AA852
Microsoft Visual C# 2015

Xamarin   4.0.1.96
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   6.0.1.10
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   9.4.1.24
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Jason Smith [MSFT] 2016-03-10 19:38:43 UTC
You must push the modal pages with NavigationPages themselves to be able to use the PushAsync path. PushAsync in effect only works on pages who have ancestors who are NavigationPages. The Modal root is the Application, and thus the NavigationPage in your MainPage is not an ancestor of the modal.