Lots of ANRs (Broadcast of Intent { act=android.intent.action.SCREEN_OFF flg=0x58200010 })

Our ANR rate is abysmal - at 0.92% vs the threshold of 0.47%. Looking into it, we see a lot of the above trace. 

Here is a trace that I was able to capture. While many of the threads seems to relate to Adjust, when we pinged adjust, they aren’t so sure it’s related to them SDK. We are using Corona 2019.3549 (2019.11.9). 

https://pastebin.com/HnwAC1rY

We can really use some help! 

FYI - I am opening a new thread from this other thread because that one was more crashes, this is ANR. Not sure if related

https://forums.coronalabs.com/topic/77022-lots-of-crashes-due-to-comnaefjnalua/#entry406284

Please also see the discussions happening here on the Adjust SDK Git: 

https://github.com/adjust/corona_sdk/issues/13#issuecomment-586516033

They seem to think that the issue is with Corona. We are at a loss. @vlad can you help? 

Thx!

So I don’t believe yours has anything to do with Adjust. It looks like an issue of playing music while the game is being pushed to the background. My suggestion is to try to stop the music when the game goes to the background. This is mostly a guess by looking at your trace logs.

Thx @agramonte… So maybe try to pause the audio when the app goes into the background? 

yes. that would be my suggestion.

@agramonte do you solve this problem?

Not all ANRS even with the same grouping are the same. You have to look at the trace and determine the cause. In my case (since I don’t use adjust) most of them were:

  1. OpenSSL connection while the phone was going on the background.
  • I tried to batch together and not do them as often and cancel them when the device goes into the background.
  1. Playing a sound or music while the phone was going to the background.

         - Removed the music and tried to clean up sounds before going into the background.

So far this has resulted in me being just under the threshold. So not resolved, but not in the red.

Please also see the discussions happening here on the Adjust SDK Git: 

https://github.com/adjust/corona_sdk/issues/13#issuecomment-586516033

They seem to think that the issue is with Corona. We are at a loss. @vlad can you help? 

Thx!

So I don’t believe yours has anything to do with Adjust. It looks like an issue of playing music while the game is being pushed to the background. My suggestion is to try to stop the music when the game goes to the background. This is mostly a guess by looking at your trace logs.

Thx @agramonte… So maybe try to pause the audio when the app goes into the background? 

yes. that would be my suggestion.

@agramonte do you solve this problem?

Not all ANRS even with the same grouping are the same. You have to look at the trace and determine the cause. In my case (since I don’t use adjust) most of them were:

  1. OpenSSL connection while the phone was going on the background.
  • I tried to batch together and not do them as often and cancel them when the device goes into the background.
  1. Playing a sound or music while the phone was going to the background.

         - Removed the music and tried to clean up sounds before going into the background.

So far this has resulted in me being just under the threshold. So not resolved, but not in the red.

Exactly the same problem, the share of ANR errors is already more than 1.92% Has anyone solved this problem?

Broadcast of Intent { act=android.intent.action.SCREEN_OFF flg=0x50200010 }, VisibleToUser

Broadcast of Intent { act=android.intent.action.SCREEN_ON flg=0x50000010 }