-
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
StrictMode violation in ShellSectionRenderer.OnCreateView()
leading to 8-second blocking during startup
#19415
Comments
Hi @BioTurboNick. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md 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. |
The stacktrace was misleading, unfortunately. On trying to find a repro, I tracked down the real source of the problem. It was really related to code I was calling in the constructor of my main page. Why doesn't any indication of the true source of the code show up in the trace? In any case, one source is from accessing So... I guess ultimately this issue is a user issue, because I'm literally reading from disk during creation of the UI. However, it seems like something could be done to improve the situation. Ensuring that the problem site can be more easily found in the debug log would do wonders. |
if you enable first chance exceptions does that break where you want? You do that by making sure there's a check in this box I might be remembering incorrectly but the stack trace might be slightly off because the exception is happening in the constructor. |
Hi @BioTurboNick. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. 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. |
It was already on, and I don't think this counts as an exception per se? Hmm. Well, maybe there's no easy improvement here... if so, feel free to close. |
Okay here's a challenge... App constructor => AppShell constructor => MainPage constructor Then Oh, I see, the guidance has changed. I must have missed this in the XF --> MAUI migration. https://learn.microsoft.com/en-us/appcenter/sdk/getting-started/xamarin says "Open the project's App.xaml.cs file and add the following line in the constructor (or in the OnStart() method for Xamarin.Forms)" |
Description
When investigating ANRs in my app, I turned on StrictMode violation logging. I found that ShellSectionRenderer.OnCreateView() is accessing the Android PreferenceManager, which results in a series of disk reads and writes (here, nearly 2 s each) during startup.
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
8.0.3
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 13
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: