两周前,Unity
上我的游戏(使用Google Play Store
制作)开始报告这么多崩溃,我不知道可能是什么问题。
"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.access$700 (WindowAndroid.java:134)
at org.chromium.ui.base.WindowAndroid$1.onVSync$5166USJ75THMGSJFDLKNAR9FELKIULIJF5N66JBFDPKN8RRI7D52ILG_0 (WindowAndroid.java:16)
at org.chromium.ui.VSyncMonitor$1.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)
答案 0 :(得分:1)
在以下情况下显示ANR:
- 在5秒内没有响应输入事件(例如按键或屏幕触摸事件)。
- BroadcastReceiver尚未在10秒内完成执行。
检查所有BroadcastReceivers,Serviced和Activities,以查找您是否在主线程上运行较长时间且持续时间较长且超过阈值。请注意,BroadcastReceiver在主线程中执行代码。
您还可以搜索代码中的任何位置是否使用Thread.sleep()
。您可以找到更多信息here