ANR(应用程序无响应)在 google 游戏控制台中崩溃,我不明白
ANR (Application not responding) crash in google play console which I don't understand
两周前,我在 Google Play Store
上的游戏(使用 Unity
制作)开始报告很多崩溃,我不知道可能是什么问题。
"main" tid=1 Native "main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 flags=1 obj=0x73960618 self=0xecf6f000
| sysTid=28247 nice=-4 cgrp=default sched=0/0 handle=0xf1a014bc
| state=S schedstat=( 2314581326 753030573 4325 ) utm=164 stm=66 core=1 HZ=100
| stack=0xff11e000-0xff120000 stackSize=8MB
| held mutexes=
#00 pc 0000000000018e9c /system/lib/libc.so (syscall+28)
#01 pc 000000000004850d /system/lib/libc.so (_ZL24__pthread_cond_timedwaitP23pthread_cond_internal_tP15pthread_mutex_tbPK8timespec+102)
#02 pc 0000000000039bb1 /data/app/com.android.chrome-Oy13PXODRGoydMIrhaZcSQ==/base.apk (???)
at org.chromium.ui.base.WindowAndroid.nativeOnVSync (Native method)
at org.chromium.ui.base.WindowAndroid.access0 (WindowAndroid.java:134)
at org.chromium.ui.base.WindowAndroid.onVSync66USJ75THMGSJFDLKNAR9FELKIULIJF5N66JBFDPKN8RRI7D52ILG_0 (WindowAndroid.java:16)
at org.chromium.ui.VSyncMonitor.doFrame (VSyncMonitor.java:22)
at android.view.Choreographer$CallbackRecord.run (Choreographer.java:909)
at android.view.Choreographer.doCallbacks (Choreographer.java:723)
at android.view.Choreographer.doFrame (Choreographer.java:655)
at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:897)
at android.os.Handler.handleCallback (Handler.java:789)
at android.os.Handler.dispatchMessage (Handler.java:98)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6938)
at java.lang.reflect.Method.invoke (Native method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)
在以下情况下显示 ANR:
- No response to an input event (such as key press or screen touch events) within 5 seconds.
- A BroadcastReceiver hasn't finished executing within 10 seconds.
检查您所有的 BroadcastReceivers、Serviced 和 Activities,看看您是否在主线程上 运行 长时间处理,持续时间更长并超过阈值。请注意 BroadcastReceiver 在主线程中执行代码。
如果您在代码中的任何地方使用 Thread.sleep()
,您也可以搜索。您可以找到更多信息 here
两周前,我在 Google Play Store
上的游戏(使用 Unity
制作)开始报告很多崩溃,我不知道可能是什么问题。
"main" tid=1 Native "main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 flags=1 obj=0x73960618 self=0xecf6f000
| sysTid=28247 nice=-4 cgrp=default sched=0/0 handle=0xf1a014bc
| state=S schedstat=( 2314581326 753030573 4325 ) utm=164 stm=66 core=1 HZ=100
| stack=0xff11e000-0xff120000 stackSize=8MB
| held mutexes=
#00 pc 0000000000018e9c /system/lib/libc.so (syscall+28)
#01 pc 000000000004850d /system/lib/libc.so (_ZL24__pthread_cond_timedwaitP23pthread_cond_internal_tP15pthread_mutex_tbPK8timespec+102)
#02 pc 0000000000039bb1 /data/app/com.android.chrome-Oy13PXODRGoydMIrhaZcSQ==/base.apk (???)
at org.chromium.ui.base.WindowAndroid.nativeOnVSync (Native method)
at org.chromium.ui.base.WindowAndroid.access0 (WindowAndroid.java:134)
at org.chromium.ui.base.WindowAndroid.onVSync66USJ75THMGSJFDLKNAR9FELKIULIJF5N66JBFDPKN8RRI7D52ILG_0 (WindowAndroid.java:16)
at org.chromium.ui.VSyncMonitor.doFrame (VSyncMonitor.java:22)
at android.view.Choreographer$CallbackRecord.run (Choreographer.java:909)
at android.view.Choreographer.doCallbacks (Choreographer.java:723)
at android.view.Choreographer.doFrame (Choreographer.java:655)
at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:897)
at android.os.Handler.handleCallback (Handler.java:789)
at android.os.Handler.dispatchMessage (Handler.java:98)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6938)
at java.lang.reflect.Method.invoke (Native method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)
在以下情况下显示 ANR:
- No response to an input event (such as key press or screen touch events) within 5 seconds.
- A BroadcastReceiver hasn't finished executing within 10 seconds.
检查您所有的 BroadcastReceivers、Serviced 和 Activities,看看您是否在主线程上 运行 长时间处理,持续时间更长并超过阈值。请注意 BroadcastReceiver 在主线程中执行代码。
如果您在代码中的任何地方使用 Thread.sleep()
,您也可以搜索。您可以找到更多信息 here