dotnet/maui · critical · NotSupportedException
ParentingViewController parent could not be found. Please fi
Error message
ParentingViewController parent could not be found. Please file a bug.
What it means
GetAppearedOrDisappearedTask resolves the ParentingViewController that hosts a page's renderer by walking ParentViewController. If the parent chain does not yield a ParentingViewController, the page's lifecycle hooks (Appearing/Disappearing) cannot be wired, so it throws NotSupportedException indicating an internal-state problem (a bug report is requested).
Source
Thrown at src/Compatibility/Core/src/iOS/Renderers/NavigationRenderer.cs:422
}
void FindParentFlyoutPage()
{
var page = Element as Page;
var parentPages = page.GetParentPages();
var flyoutDetail = parentPages.OfType<FlyoutPage>().FirstOrDefault();
if (flyoutDetail != null && parentPages.Append((Page)Element).Contains(flyoutDetail.Detail))
_parentFlyoutPage = flyoutDetail;
}
Task<bool> GetAppearedOrDisappearedTask(Page page)
{
var tcs = new TaskCompletionSource<bool>();
var parentViewController = Platform.GetRenderer(page).ViewController.ParentViewController as ParentingViewController;
if (parentViewController == null)
throw new NotSupportedException("ParentingViewController parent could not be found. Please file a bug.");
EventHandler appearing = null, disappearing = null;
appearing = (s, e) =>
{
parentViewController.Appearing -= appearing;
parentViewController.Disappearing -= disappearing;
Device.BeginInvokeOnMainThread(() => { tcs.SetResult(true); });
};
disappearing = (s, e) =>
{
parentViewController.Appearing -= appearing;
parentViewController.Disappearing -= disappearing;
Device.BeginInvokeOnMainThread(() => { tcs.SetResult(false); });
};
View on GitHub (pinned to f377ff1c5e)
Solutions
- Keep pages inside the standard NavigationPage/Page presenter hierarchy.
- Avoid reparenting the page's UIViewController externally.
- Verify no third-party navigation library intercepts the controller hierarchy.
- If using FlyoutPage, ensure Detail is a NavigationPage and not reparented.
Defensive patterns
Strategy: validation
Prevention
- Keep pages within the standard NavigationPage presenter hierarchy.
- Avoid external UIViewController reparenting.
- Do not let third-party navigation libraries own the controller chain.
When it happens
Trigger: The page's renderer.ViewController.ParentViewController is not a ParentingViewController - e.g. the view controller was reparented into a custom container, the navigation hierarchy was manipulated externally, or a flyout/detail structure changed unexpectedly.
Common situations: Embedding a NavigationPage inside a custom UIViewController container; custom presenters; version/compat mismatches after upgrading MAUI; page rendered outside the standard NavigationPage host.
Related errors
- Popped page does not appear on top of current navigation sta
- InsertPageBefore is not supported globally on iOS, please us
- PopAsync is not supported globally on iOS, please use a Navi
- PopToRootAsync is not supported globally on iOS, please use
- PushAsync is not supported globally on iOS, please use a Nav
AI-assisted analysis of dotnet/maui@f377ff1c5e (2026-08-13).
Data as JSON: /api/errors/bc8773a488340570.
Report an issue: GitHub.