ANR, Crashes & slow rendering

ANR, Crashes & slow rendering


Hello Devs and Cocos Team,
My Android game on Google Play is suffering a lot. I’m seeing very bad reports even I recently updated my game with latest cocos2dx 3.16 and sdkbox/Admob is updated to the latest.

How do I solve these issues? Is there any tools or way out to check on which point these slow rendering or ANR is happening? PLEASE HELP!!! @walzer @nite @zhangxm @yinjimmy


as I know, 3.14.1 is better.


There is no need to tag a lot of people for attention. These forums are reviewed by engineering already. Or tag me so I can work out getting you help.


ok I won’t do it from next time. What do you suggest on my above issues ?


@jeevs I am not sure.

@yinjimmy are you saying that v3.16 doesn’t work with the current SDKBOX plugins and are suggesting the OP switch back to 3.14?


Are there any useful anr/crash logs? What can you see behind the view details text?


Yes there are hell lot of reports which I don’t understand. This is the screenshot of the ANR reports.
And below is the details of the first cluster(ANR).
If you would like to see I can send you the reports in csv or excel file in PM.
Can you figure it out what’s exactly going wrong?

“main” tid=1 Waiting
“main” prio=5 tid=1 Waiting
| group=“main” sCount=1 dsCount=0 obj=0x75b8c000 self=0xb4827800
| sysTid=22161 nice=-4 cgrp=default sched=0/0 handle=0xb6fa2bec
| state=S schedstat=( 0 0 0 ) utm=3179 stm=1027 core=0 HZ=100
| stack=0xbe67f000-0xbe681000 stackSize=8MB
| held mutexes=
at java.lang.Object.wait! (Native method)

  • waiting on <0x0cd95830> (a android.opengl.GLSurfaceView$GLThreadManager)
    at android.opengl.GLSurfaceView$GLThread.surfaceDestroyed (
  • locked <0x0cd95830> (a android.opengl.GLSurfaceView$GLThreadManager)
    at android.opengl.GLSurfaceView.surfaceDestroyed (
    at android.view.SurfaceView.updateWindow (
    at android.view.SurfaceView.onWindowVisibilityChanged (
    at android.view.View.dispatchWindowVisibilityChanged (
    at android.view.ViewGroup.dispatchWindowVisibilityChanged (
    at android.view.ViewGroup.dispatchWindowVisibilityChanged (
    at android.view.ViewGroup.dispatchWindowVisibilityChanged (
    at android.view.ViewRootImpl.performTraversals (
    at android.view.ViewRootImpl.doTraversal (
    at android.view.ViewRootImpl$ (
    at android.view.Choreographer$ (
    at android.view.Choreographer.doCallbacks (
    at android.view.Choreographer.doFrame (
    at android.view.Choreographer$ (
    at android.os.Handler.handleCallback (
    at android.os.Handler.dispatchMessage (
    at android.os.Looper.loop (
    at (
    at java.lang.reflect.Method.invoke! (Native method)
    at java.lang.reflect.Method.invoke (
    at$ (
    at (


No. It’s not about SDKBox, it’s about cocos2d-x.

I remember that cocos2d-x 3.14.1 is more stable than others, data from @energyy.


what I can help is

it’s ok to PM me.


Yes, we recommend to switch to cocos 3.14 or 3.15.1 - 3.16 by some unknown reason is disaster in production.


Thanks for letting me know this. Let me talk to the engineering team.


The SCREEN_ON/SCREEN_OFF intents or receiver aren’t in the cocos engine (or I’m to blind to find them). That’s weird.

Can you check your AndroidManifest.xml, if SDKBox adds them?


I can’t find any related things added in the xml by SDKBOX.
Please see below the xml if you would like to see.


You need to look into the merged manifest. Every (gradle) dependency is able to inject data into your AndroidManifest.xml file. What’s the packageName of your game, so I can install and check it by myself.


Yes I checked the merged xml too and found no extra thing added. My game’s package id is com.js.ludo .


Slow Rendering flag is because of ad sdks. You can read more about them here!topic/google-admob-ads-sdk/yPH7H3EWVBM


For ads, I’m using Admob through SDKBOX only. Putting ad is the only option I’ve got for monetization. So no solution for this issue? :frowning: Or is there any thing SDKBOX can optimize on their part to minimize this issue?


@slackmoehrle Did you got any new on that?

@energyy Also, may I ask which SDK/NDK do you recommend for 3.14 or 3.15.1?

Also, last but not least, 3.15.1 or 3.14.1? Android Studio support (introduced in 3.15) “shouldn’t” be decisive factor to choose 3.15.1 over 3.14.1, any other reason should apply and, if possible, be explained.

Thanks :slight_smile:



We using 3.15.1 - but 3.14 also is good working one, for NDK we chosed NDK 13B .

Regarding android studio support - it’s totally not problem to add it to any cocos version, u just need to copy over build.gradle file from 3.15 and add some extra gradle config files and it will work same. There is just one extra command added which running NDK compile from gradle .


you can call plugin::init after use enter your game main scene.

    time_after(2 seconds, plugin::init());