erisu commented on issue #1510:
URL: 
https://github.com/apache/cordova-android/issues/1510#issuecomment-1283798761

   @KekGames 
   
   I am just thinking aloud here but based on your last comment and my 
understanding of the ANR, it is possible that the loading of the game is 
blocking and causing the ANR to increase.
   
   > While the game is actually loading.
   
   Generally, I read that App Not Responding (ANR) starts to arise when an 
Activity has not finished an operation within 5 seconds.
   
   Are you using the Splash Screen configurations `AutoHideSplashScreen = 
false` and manually hiding the splash screen with the `.hide()` method when the 
game has finished loading?
   
   Android 12 Splash Screen:
   > Duration: We recommend not exceeding 1,000 ms on phones. You can use a 
delayed start, but this can’t be longer than 166 ms. If the app startup time is 
longer than 1,000 ms, consider a looping animation.
   
   I am not sure what happens in cases where the app is delayed longer than 
anything listed above but I suspect it leads to ANR. Also in regards to looping 
animation, I haven't tested this, don't know if that will help in any way if 
implemented, and it might be related to AVD which was not implemented until API 
25.
   
   If my memory is correct, the previous splash screen plugin was just an image 
overlaying the WebView. Since the Activity would have already been loaded 
before the Splash Screen displayed, I suspect this is why ANR was not an issue.
   
   But, as Google is now forcing the new Splash Screen for all Android 12+ 
devices, I believe you seeing ANR because the game loading could be holding up 
the Activity. 
   
   Again, this is an assumption based on how you configured Splash Screen. And 
again I haven't fully investigated all information so there could be something 
off.
   
   If the assumption on how you're hiding the Splash Screen is correct, could 
you try setting `AutoHideSplashScreen = true` and see what happens with ANR?
   
   Maybe creating a loading screen will be required and displaying it while the 
game is loading, but do not use the Splash Screen as the loading process.
   
   E.g Splash Screen -> Loading Screen -> Game 
   
   Anyways, I am just thinking a loud and hopefully, some of this might be 
useful.
   
   I also want to point out that you might want to create an ANR trace? Not 
sure if this will help us.
   
   https://developer.android.com/topic/performance/vitals/anr#pull_a_traces_file
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to