A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
Hi @Eduardo Gomez ,
Thanks for reaching out.
From the code and description you provided, the Android.Runtime.JavaProxyThrowable might be happening because the app could be attempting navigation too early in the startup process. On Android, MAUI’s UI elements, including Shell and its navigation stack, may not be fully initialized until after the Window is created and the visual tree is ready. Attempting GoToAsync in the constructor of AppShell or in OnStart can sometimes lead to crashes if the Shell isn’t ready to process navigation.
Here are some points to consider:
- Navigation should generally happen after Shell is initialized. The official docs for
Shell.GoToAsyncexplain that navigation is asynchronous and works best once the navigation stack is ready: https://learn.microsoft.com/en-us/dotnet/api/microsoft.maui.controls.shell.gotoasync?view=net-maui-10.0 - Routes need to be registered before calling
GoToAsync. The Shell navigation documentation shows how to define routes and mentions that navigation assumes routes are already registered: https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/shell/navigation?view=net-maui-10.0 - Modal pages on startup may introduce additional timing considerations. The Shell pages documentation explains modal presentation and navigation stack behavior: https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/shell/pages?view=net-maui-9.0
Possible guidance:
- Consider deferring navigation until the Shell is fully created, for example inside
CreateWindowafter the window is initialized or inOnAppearingof a startup page. - Ensure that all routes are registered before calling
GoToAsync. - Await all
GoToAsynccalls and avoid starting multiple navigation operations simultaneously.
Following these patterns might help reduce the chance of crashes on Android related to early navigation, though actual results can vary depending on timing and platform behavior.
Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.