-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Crash when changing mainpage #17769
Comments
Added note. |
Hi @Gekidoku. 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. |
What latest version? |
Since this has been inactive for a while I was messing around for a bit. Here are instructions to test each one, Variant two, Variant three, Make variant three work. (sometimes) |
@PureWeen can you take a look at this again? |
I think this is a duplicate of |
One key difference for me, dont know how it works under the hood but it might be important to note. In that issue it seems the crash happens while the app doesnt leave the foreground. |
I found the cause in Android. Error Message : "Can not perform this action after onSaveInstanceState"
|
Verified this issue with Visual Studio Enterprise 17.10 Preview 1.0, can use sample project to reproduce the errors in the above three scenarios on Android platform. |
If other cases would help, I'm getting this on It looks like if |
Description
The following crash keeps arriving in my appcenter crash log.
So far i've been unable to reproduce it but customers are getting angry and want a solution.
The one function i can find in this log thats my code is LogoutUser.
Its called by OnResume and both OnResume and LogoutUser are situated in the App.xaml.cs file in the root of my Maui project
Which is the following function called at the end of my OnResume if certain conditions are met.
Conditions are.
Both of these conditions happen in the onresume function
which is basically
So no weird things happen here. just a switch of the mainpage if a user shouldnt be logged in anymore (app contains customer info and a employee should only be able to access it when they are on a shift, they could be on a page with data when they resume the app so its handled in this way).
Ive done some digging to differences in MAUI and Xamarin.forms.
And ive spotted the following.
In MAUI in the navigation root manager at line 133 and 150 there is a .commit();
However in Xamarin.Forms i see that this had been changed to CommitAllowingStateLoss(); xamarin/Xamarin.Forms@b444ebb
Not that i know enough about the internals of maui just thought id find something that could function as a starting point.
Hope you can give me some help with this. As my customers are all security guards that call at impossible times at night because the app crashed due to this.
Steps to Reproduce
Cant reproduce it myself. but the crashlogs arrive in appcenter so it must be happening.
Link to public reproduction project repository
https://github.com/Gekidoku/UnfocusTest
Version with bug
7.0.92
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
Android, I was not able test on other platforms
Affected platform versions
Android33
Did you find any workaround?
No
Relevant log output
No response
The text was updated successfully, but these errors were encountered: