Today, I’ve brought up a chronic issue we’re facing. We’ve been trying to resolve it on our own, but it seems quite challenging.
First, let me outline our development environment:
Cocos Creator Version: 3.8.1
Target SDK: 33
We’re currently using these for our game.
We’ve been experiencing frequent ANRs (Application Not Responding) while our game is live. This issue seems to have started after upgrading to this engine version from the previous 3.7.x, which didn’t have this problem.
The ANR logs are as follows, but I’m not sure where to start in terms of troubleshooting.
Is there anyone who can help us out with this?
#00 pc 0x0000000000089af4 /apex/com.android.runtime/lib64/bionic/libc.so (syscall+36) #01 pc 0x000000000008e4d8 /apex/com.android.runtime/lib64/bionic/libc.so (__futex_wait_ex+148) #02 pc 0x00000000000f4964 /apex/com.android.runtime/lib64/bionic/libc.so (pthread_cond_timedwait+140) #03 pc 0x00000000002ae670 /data/app/~~hjYYL-mYHtFeiwyui7-eTA==/com.chamelio.magicraft-KQsKaOo5pPC5yt0v7HB1Hg==/split_config.arm64_v8a.apk (android_app_set_activity_state+307200) (BuildId: b265e677a1024ac1fb31fefcb35a23d932ce41da)
at com.google.androidgamesdk.GameActivity.onPauseNative (GameActivity.java)
at com.google.androidgamesdk.GameActivity.onPause (GameActivity.java:299)
The logs I shared are from the Google Play Developer Console. Currently, it’s challenging to reproduce the issue, so it’s difficult to identify the exact error point on our own. If there’s another way to obtain the logs, please let me know. I’ll then attach the file again. @freely0417
We got the same ANR on 3.8.x, it’s very small impact on our game but we have it too.
We don’t use large audio file and as gandangf we cannot reproduce it, we just see this on google play.
@Azaratur Are there reward-based ads in your game too? Based on my current guess, it seems that issues mainly occur when the reward-based ad logic is executed.
Sorry I always forget to check this forum…
We have implemented Google Admob Rewarded videos, but as far as I see we got that ANR any time the app goes in pause.
In your game, what is the approximate size of the audio files, how many can be played simultaneously, and what is the maximum number?
Are there logs from other threads when an ANR occurs?
Audio are not the problem. We did test it even without audio.
Also the ANR is clrearly on “onPauseNative”, so it’s should be related to some sort of lag between comunication from java to c++/js
After reward ad logic executed. What tasks have you executed and how did you notify the game?
There is no any task on Java code, just a call to ‘CocosJavascriptJavaBridge.evalString’ and nothing else on Typescript.
That’s not a reward but an Interstitial.