ANR 输入调度超时
ANR Input dispatching timed out
ANR 输入调度超时(等待发送非键事件,因为触摸 window 尚未完成处理超过 500.0 毫秒前传递给它的某些输入事件。等待队列长度:60。等待队列头年龄:8503.2ms。)
嗨!我从几个用户那里收到了这份奇怪的 ANR 报告。不幸的是,我对 ANR 报告的了解非常有限,我希望有人能帮助我了解这可能是什么原因
"main" prio=5 tid=1 Suspended
| group="main" sCount=1 dsCount=0 obj=0x74a20f90 self=0x557fe6f9d0
| sysTid=23849 nice=1 cgrp=top_visible sched=0/0 handle=0x7faf4f5000
| state=S schedstat=( 79111961552 2206905376 39235 ) utm=7534 stm=377 core=7 HZ=100
| stack=0x7fdaaf0000-0x7fdaaf2000 stackSize=8MB
| held mutexes=
at android.os.MessageQueue.removeMessages(MessageQueue.java:682)
- locked <0x08f02647> (a android.os.MessageQueue)
at android.os.Handler.removeMessages(Handler.java:652)
at android.view.Choreographer.removeCallbacksInternal(Choreographer.java:418)
- locked <0x0bd41e74> (a java.lang.Object)
at android.view.Choreographer.removeCallbacks(Choreographer.java:406)
at android.view.View.removeCallbacks(View.java:13179)
at android.support.v4.widget.aa.a(unavailable:-1)
at android.support.v4.widget.DrawerLayout.a(unavailable:-1)
at android.support.v4.widget.DrawerLayout.onInterceptTouchEvent(unavailable:-1)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2108)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2525)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2525)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2525)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2525)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2525)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2525)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2525)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2461)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1777)
at android.app.Activity.dispatchTouchEvent(Activity.java:2865)
at android.support.v7.view.n.dispatchTouchEvent(unavailable:-1)
at android.support.v7.view.n.dispatchTouchEvent(unavailable:-1)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2422)
at android.view.View.dispatchPointerEvent(View.java:9610)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4436)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4302)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3836)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3889)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3855)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3981)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3863)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4038)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3836)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3889)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3855)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3863)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3836)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6135)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6109)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6070)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6251)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:192)
at android.os.MessageQueue.nativePollOnce(Native method)
at android.os.MessageQueue.next(MessageQueue.java:330)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5546)
at java.lang.reflect.Method.invoke!(Native method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
当我有一个循环并且有一个循环递增的条件时,这发生在我身上。我没有设置不满足条件时的增量。因此,循环停止了。这导致了上述错误。
没有你的代码,我无能为力。但以上是您错误的可能原因。
很明显,你的anr日志不完整。它只显示主线程日志,还有什么
线程日志。
在主线程中,从这个"main" prio=5 tid=1 Suspended
,我们知道线程被挂起。在此之前,它
- locked <0x08f02647> (a android.os.MessageQueue) at android.os.Handler.removeMessages(Handler.java:652) at android.view.Choreographer.removeCallbacksInternal(Choreographer.java:418)
- locked <0x0bd41e74> (a java.lang.Object)
您应该搜索日志以检查哪个线程等待锁定 <0x08f02647> 和 <0x0bd41e74>,您可能会找到一些线索。
ANR 输入调度超时(等待发送非键事件,因为触摸 window 尚未完成处理超过 500.0 毫秒前传递给它的某些输入事件。等待队列长度:60。等待队列头年龄:8503.2ms。)
嗨!我从几个用户那里收到了这份奇怪的 ANR 报告。不幸的是,我对 ANR 报告的了解非常有限,我希望有人能帮助我了解这可能是什么原因
"main" prio=5 tid=1 Suspended
| group="main" sCount=1 dsCount=0 obj=0x74a20f90 self=0x557fe6f9d0
| sysTid=23849 nice=1 cgrp=top_visible sched=0/0 handle=0x7faf4f5000
| state=S schedstat=( 79111961552 2206905376 39235 ) utm=7534 stm=377 core=7 HZ=100
| stack=0x7fdaaf0000-0x7fdaaf2000 stackSize=8MB
| held mutexes=
at android.os.MessageQueue.removeMessages(MessageQueue.java:682)
- locked <0x08f02647> (a android.os.MessageQueue)
at android.os.Handler.removeMessages(Handler.java:652)
at android.view.Choreographer.removeCallbacksInternal(Choreographer.java:418)
- locked <0x0bd41e74> (a java.lang.Object)
at android.view.Choreographer.removeCallbacks(Choreographer.java:406)
at android.view.View.removeCallbacks(View.java:13179)
at android.support.v4.widget.aa.a(unavailable:-1)
at android.support.v4.widget.DrawerLayout.a(unavailable:-1)
at android.support.v4.widget.DrawerLayout.onInterceptTouchEvent(unavailable:-1)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2108)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2525)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2525)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2525)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2525)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2525)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2525)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2525)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2461)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1777)
at android.app.Activity.dispatchTouchEvent(Activity.java:2865)
at android.support.v7.view.n.dispatchTouchEvent(unavailable:-1)
at android.support.v7.view.n.dispatchTouchEvent(unavailable:-1)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2422)
at android.view.View.dispatchPointerEvent(View.java:9610)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4436)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4302)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3836)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3889)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3855)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3981)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3863)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4038)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3836)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3889)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3855)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3863)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3836)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6135)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6109)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6070)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6251)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:192)
at android.os.MessageQueue.nativePollOnce(Native method)
at android.os.MessageQueue.next(MessageQueue.java:330)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5546)
at java.lang.reflect.Method.invoke!(Native method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
当我有一个循环并且有一个循环递增的条件时,这发生在我身上。我没有设置不满足条件时的增量。因此,循环停止了。这导致了上述错误。
没有你的代码,我无能为力。但以上是您错误的可能原因。
很明显,你的anr日志不完整。它只显示主线程日志,还有什么 线程日志。
在主线程中,从这个"main" prio=5 tid=1 Suspended
,我们知道线程被挂起。在此之前,它
- locked <0x08f02647> (a android.os.MessageQueue) at android.os.Handler.removeMessages(Handler.java:652) at android.view.Choreographer.removeCallbacksInternal(Choreographer.java:418)
- locked <0x0bd41e74> (a java.lang.Object)
您应该搜索日志以检查哪个线程等待锁定 <0x08f02647> 和 <0x0bd41e74>,您可能会找到一些线索。