-
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
Maui App using R8 & MauiHybridWebView crashes whenever it is killed in background by Android and then restarted by OS #22590
Comments
Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! Open similar issues:
Closed similar issues:
|
Can you attach a logcat file with your crash? |
I was able to figure out this is a MauiHybridWebView issue. Any project with MauiHybridWebView added displays this crash behavior when also built with R8 in Android. @Eilon I posted another bug report here with more details and a reproduction project/instructions: Eilon/MauiHybridWebView#66 |
Duplicate of Eilon/MauiHybridWebView#66 |
UPDATE
I was able to figure out this is a MauiHybridWebView issue. Any project with a MauiHybridWebView added crashes when the OS restarts it if it was also built to Android with R8.
I posted another bug report here with more details and a reproduction project/instructions: Eilon/MauiHybridWebView#66
Description
Maui Crash Behavior
I have been observing a behavior which I am having a hard time figuring out the meaning of or how to investigate or fix it:
Android Lifecycle
Having reviewed the Android lifecycle here: https://stackoverflow.com/questions/4267897/what-happens-to-activities-services-when-phone-goes-to-sleep-standby-mode#4268025
I suspect what is happening is that when the phone is idle or doing other things long enough, it eventually runs
onStop()
to free the resources killing the active app.Then when you navigate back to the "open" app it runs
onCreate()
oronRestart()
. At this point it briefly shows the splash screen again, but this time the creation or starting of app fails and it crashes.Investigation/Solution?
The problems I have in trying to find out what is causing this (and whether Maui code problem or mine) are:
Would loading the APK in Android Studio offer any special tools to figure out what is happening? Any suggestions?
Thanks.
Steps to Reproduce
Unpredictable. Leave app running with phone screen off or doing other activities in other apps. Several hours later, if OS likely has stopped it in background, attempting to return to it will trigger the splash screen momentarily and then it will crash and not resume.
Link to public reproduction project repository
n/a
Version with bug
8.0.40 SR5
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
The text was updated successfully, but these errors were encountered: