-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Increased number of ANRs after updating to Android 12 platform #1650
Comments
If you're delaying the dismissal of the newer android splashscreen system introduced in cordova-android@11, it will trigger an ANR report. The splashscreen should only appear roughly for about 1 second, but I think there is a 5 second timer for ANR triggers. So that would be the first thing I'd check. |
Here are the preferences associated with the splashscreen in the config.xml: <preference name="AutoHideSplashScreen" value="true" />
<preference name="SplashScreenDelay" value="0"/>
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="FadeSplashScreenDuration" value="500" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="AndroidWindowSplashScreenAnimatedIcon" value="res/screen/android/logo.png" />
<preference name="AndroidWindowSplashScreenBackground" value="#ffffff" />
<preference name="AndroidWindowSplashScreenIconBackgroundColor" value="#ffffff" /> I must mention that I am using this hook #1465 (comment) to edit the themes.xml file in order to set windowLayoutInDisplayCutoutMode to "never". |
Your config indicates that you're letting Cordova auto hides the splashscreen with a You can have a look at the splashscreen plugin that's embedded into the cordova framework to see when it exactly dismisses it. Note that by explicitly assigning If this is taking more than 5 seconds to trigger then it could be a cause for the ANR. If this is the case, I suspect a plugin or plugin(s) to be the cause of the delay. If you remove the For more info on how splashscreens trigger ANR you can read: #1510 If your splashscreen is dismissing quickly (less than 5 seconds), then splashscreen is probably not the source of your ANR. In which case, you'll probably need to use Android Studio to trace the problem. |
I've done a lot of testing with Setting By reading the documentation on SplashScreenDelay it says that When I compare the app to other apps, the startup time is about twice to three times slower. Is there a way to hide the splashscreen before the page loads without setting a custom delay? |
Bug Report
Problem
Google Android Vitals are reporting an increased amount of ANRs after updating to the Cordova Android 12 platform.
Information
I am unsure if the ANRs are caused by the new Cordova platform update or by the new Android SDK version. Since I was unable to find any issue similar to this, I decided to open one here. Any information related to this ANR would be most helpful, as I am unable to reproduce it. I am also curious if any other developers are experiencing the same thing.
Google stack trace
Environment, Platform, Device
The ANR details specify that this ANR has been reported on Android 11, Android 12 and Android 13 devices. Here are some of the specific devices: BLU M0176_ND, NUU T0801LAV2, samsung a20p, samsung gta4lwifi, motorola borneo.
Version information
cordova 12.0.0
android 12.0.0
Checklist
The text was updated successfully, but these errors were encountered: