Question

I have some applications published in Google Play Market and I keep getting an ANR (Application Not Responding) reports for keyDispatchingTimedOut in my MainActivity. As you know, Google provides me a Thread Dumps with it. I don't know how to analyze it, which part should I look closer.

I tested the application with all android versions using Virtual Devices in eclipse, all worked fine.

Here is a few lines from my Thread Dumps, the full list is really long.

DALVIK THREADS:
(mutexes: tll=0 tsl=0 tscl=0 ghl=0 hwl=0 hwll=0)
"main" prio=5 tid=1 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x4002a278 self=0xcf50
| sysTid=142 nice=0 sched=0/0 cgrp=default handle=-1345006528
at com.android.server.SystemServer.init1(Native Method)
at com.android.server.SystemServer.main(SystemServer.java:701)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)

"loc_api" prio=5 tid=52 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x408df0a8 self=0x263238
| sysTid=521 nice=0 sched=0/0 cgrp=default handle=2593632
at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #9" prio=5 tid=44 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x406f41d8 self=0x26a7a0
| sysTid=435 nice=0 sched=0/0 cgrp=default handle=2714632
at dalvik.system.NativeStart.run(Native Method)

"DHCP Handler Thread" prio=5 tid=54 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x4077a508 self=0x25f700
| sysTid=356 nice=0 sched=0/0 cgrp=default handle=2500272
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:119)
at android.os.Looper.loop(Looper.java:117)
at android.os.HandlerThread.run(HandlerThread.java:60)

Any help is appreciated.

Était-ce utile?

La solution

I'm currently having the same issue. The ANRs in the Google Play Console unfortuneately cut off the interesting parts. But I was able to kind of reproduce it once and adb logcat gave me the following output:

W/ActivityManager(  340): Launch timeout has expired, giving up wake lock!
W/ActivityManager(  340): Activity idle timeout for HistoryRecord{40bb6948

which lead to the folling stackoverflow entry:

Activity Idle Timeout for ActivityRecord

The post suggests checking for a GlobalChangeListener causing a looping invalidation of the Activity Layout, which was the case at least for our app. This error doesn't always end in an ANR though:

https://groups.google.com/forum/?fromgroups=#!topic/android-developers/TfkPlN5b-ig

Maybe that helps!

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top