-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
navHost cannot be null after app2app #15788
Comments
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
@PureWeen thoughts? |
Hi @tkern46. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version. You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Hi, the exception still occures with the latest releases. We've tried it with Visual Studio Preview 17.7.0 Preview 2.0 and the .net8 preview. |
note this exception doesn't occur, if you create a custom Window in App.xaml.cs.CreateWindow() and set the MainPage in this Window instead of the App. |
Verified this issue with Visual Studio Enterprise 17.9.0 Preview 2. Can repro on android platform with sample project. |
Can you test with the latest nightly build? My thinking is that you'll need to set the launchmode on your android activity to "SingleTop" in order to fix your exception. We've added an additional exception message as well in case that's what you're hitting. |
Hi @tkern46. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version. You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Description
I noticed an InvalidOperationException (NavHost cannot be null) after app-to-app-communication via intents.
To reproduce this bug I have created 2 App (LoginApp and CallingApp). The LoginApp called via intent out of CallingApp. To simulate the login-process, the LoginApp waits for 2 seconds and finishes the intent. When the intent is finished and you go back into the LoginApp, the LoginApp crashes because the navHost is null.
It did not crash using Xamarin with dotnet 2.1.
Steps to Reproduce
Link to public reproduction project repository
https://github.com/tkern46/navhost-connot-be-null-after-app2app.git
Version with bug
7.0.86
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android API 29
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: