-
Notifications
You must be signed in to change notification settings - Fork 1.8k
System.NullReferenceException at NavigationRenderer.SetStatusBarStyle() #29535
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
Comments
We've found some similar issues:
If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.
|
Can you extract out something into a repro? That direct code hasn't changed in a number of years so it's hard to say. NET9 does cleanup code a bit more aggressively than NET8 did so I'm guessing that's related |
For me, the exception does not happen in all reproductions, it is something almost random. I am not using shell for navigation. I can describe that I have a Login screen for the tenant, I create a navigation stack for another user login screen. When the login is successful I need to replace the app's mainPage with a Flyout Page that contains the menu items and the Details screen. I know this is not the best way to do it, but using Navigation I did not get the desired behavior. Only in this specific situation I replace:
When the app is closed and opened again, if the user is already logged in, I directly assign the MainPage as my Flyout once. This does not cause any exceptions, only if my home page is not instantiated at all. Explanation:
Because the HomePage was already created one time. This seems like just a coincidence, but it was noticed. I can't say that this is what is causing the error. I confess that this situation is making me lose my hair. I am available for any information and help needed. |
@PureWeen can you please /azp, so that @MateusMiotto can try if this PR fixes it |
@MateusMiotto where you able to try the nugets from @kubaflo 's PR? |
This fix is avaliable in any published version? |
@MateusMiotto No, it isn't. We would like you to test this pr: #29564 according to these docs: https://github.com/dotnet/maui/wiki/Testing-PR-Builds It is because we want to know if the changes fix your crash since you did not attach any repro and we cannot reproduce it |
I followed the tutorial link and spent a few hours today to test this fix and it worked fine, the exception doesn't happen anymore. |
Uh oh!
There was an error while loading. Please reload this page.
Description
After migrating from .net8 to .net9 this issue appeared.
After navigating from a login screen to the app's home page, which does not have a status bar, I receive a System.NullReferenceException
I am using NavigationPage.HasNavigationBar as false at HomePage but using it as true did not throw an exception in my tests
The Home page is a FlyoutPage and the details is the page with the tag NavigationPage.HasNavigationBar
This crash happens only when i try to navigate from login page to home page, if the application starts directly in that, the exception doesn't happens, using NavigationPage.HasNavigationBar as true or false.
Steps to Reproduce
I don't know exactly the reason of that, so, don't have a sample
Link to public reproduction project repository
No response
Version with bug
9.0.70 SR7
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.80 SR8
Affected platforms
iOS
Affected platform versions
iOS only
Did you find any workaround?
Nop
Relevant log output
The text was updated successfully, but these errors were encountered: