Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Getting exception while navigating in Release mode on iOS #3097

Open
Himanshu045 opened this issue Mar 1, 2024 · 2 comments
Open

[BUG] Getting exception while navigating in Release mode on iOS #3097

Himanshu045 opened this issue Mar 1, 2024 · 2 comments

Comments

@Himanshu045
Copy link

Description

I'm having a strange issue with .net MAUI, when I run app in release mode on iOS navigation is not working, I'm getting below exception.
When i'm clicking first time on button for Navigation i'm getting below exception,

Prism.Navigation.NavigationException: An error occurred while resolving the page. This is most likely the result of invalid XAML or other type initialization exception

second time when I'm clicking same button I'm getting different exception,

Prism.Navigation.NavigationException: An unsupported event occurred while Navigating. The attempted Navigation Stack is not supported by .NET MAUI

App is working fine in debug mode on both Android and iOS, but in release mode it is only working on Android.

Steps to Reproduce

Create new blank MAUI app
Add Prism.DryIoc.Maui 9.0.271-pre

  • Add two View: named ViewA, ViewB
  • Add ViewModels: named ViewModelA, ViewModelB
    Add a button on ViewA to Navigate to ViewB
    Add command on ViewModelA for navigation

private async Task DoGoToViewB()
{
_navigationService.NavigateAsync("ViewB")
.OnNavigationError(ex => Console.WriteLine("\nDoGoToViewB-------- " + ex)); ;
}

register View and ViewModels in MauiProgram

private static void RegisterNavigationDependency(IContainerRegistry containerRegistry)
{
containerRegistry.RegisterForNavigation();
containerRegistry.RegisterForNavigation<ViewA, ViewModelA>();
containerRegistry.RegisterForNavigation<ViewB, ViewModelB>();
}

set onAppStart:

.UseMauiApp().
UsePrism(prism =>
{
prism.RegisterTypes(RegisterNavigationDependency);
prism.OnAppStart("ViewA");

        })

Platform with bug

.NET MAUI

Affected platforms

iOS

Did you find any workaround?

No response

Relevant log output

No response

@dansiegel
Copy link
Member

All bug reports require a reproduction app

@Himanshu045
Copy link
Author

TestNav.zip
@dansiegel Please find reproduction app

@dansiegel dansiegel added the MAUI label Mar 1, 2024
@dansiegel dansiegel reopened this Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants