No Root Window has been created
Frizbi22 opened this issue · comments
Description
After updating from version 9.0.271-pre to 9.0.401-pre, I encountered an issue specific to iOS where the root window cannot be created. This issue is peculiar because it works fine on Android, and even with version 9.0.401 on iOS, using .OnAppStart instead of .CreateWindow resolves the problem. However, this workaround only functions during debugging. As soon as debugging is stopped and the app is run normally, it crashes immediately after the splash screen.
Steps to Reproduce
Platform with bug
.NET MAUI
Affected platforms
iOS
Did you find any workaround?
Not yet!!
Relevant log output
0:] An error occurred: 'Expected Navigation Failed. No Root Window has been created.'. Callstack: ' at Prism.Navigation.PrismWindowManager.CreateWindow(Application app, IActivationState activationState)
at Microsoft.Maui.Controls.Application.CreateWindow(IActivationState activationState)
at Microsoft.Maui.Controls.Application.Microsoft.Maui.IApplication.CreateWindow(IActivationState activationState)
at Microsoft.Maui.Platform.ApplicationExtensions.CreatePlatformWindow(IApplication application, UIWindowScene windowScene, NSDictionary[] states)
at Microsoft.Maui.Platform.ApplicationExtensions.CreatePlatformWindow(IUIApplicationDelegate platformApplication, IApplication application, UIApplication uiApplication, NSDictionary launchOptions)
at Microsoft.Maui.MauiUIApplicationDelegate.FinishedLaunching(UIApplication application, NSDictionary launchOptions)
at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 58
at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 94
(String[] args) in :line 13
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)'
The app has been terminated.
The problem exists within your code. I cannot tell you what it is for a variety of reasons...
- you failed to provide a reproduction
- you haven't captured the NavigationResult which would tell you why the Navigation failed
Remember that Prism.Maui provides a mechanism to observe all Navigation events and report back what happened so that you can globally handle it which can include logging it centrally.