Autore Topic: Problema della mia applicazione o dell'utente? (ANR keyDispatchingTimedOut)  (Letto 689 volte)

Offline elegos

  • Nuovo arrivato
  • *
  • Post: 44
  • Respect: +7
    • Mostra profilo
  • Dispositivo Android:
    Nexus One
  • Play Store ID:
    Giacomo Furlan
  • Sistema operativo:
    Mac OS X
Salve a tutti!
Oggi mi sono reso conto quanto certi errori siano criptici... mi è arrivato dal Market un crash log tutto strano e non riesco a capire neanche cosa voglia dire: ANR keyDispatchingTimedOut. Se non ho capito male si riferisce a questa riga di codice: org.elegosproject.romupdater.DownloadPackage.checkHttpFile(DownloadPackage.java:50)

Qualcuno saprebbe illuminarmi? Devo semplicemente racchiudere il getResponseCode() in un try ... catch? Ho provato a fare test locali anche in assenza di Internet, ma non sono riuscito a riprodurre l'errore!

Codice: [Seleziona]
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=0x400221a8 self=0xce38
  | sysTid=1090 nice=0 sched=0/0 cgrp=default handle=-1345006528
  | schedstat=( 5004486066 2409759539 2025 )
  at java.net.InetAddress.getaddrinfo(Native Method)
  at java.net.InetAddress.lookupHostByName(InetAddress.java:501)
  at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)
  at java.net.InetAddress.getAllByName(InetAddress.java:256)
  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:68)
  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:48)
  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.connect(HttpConnection.java:298)
  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89)
  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:285)
  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:267)
  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.retrieveResponse(HttpURLConnectionImpl.java:1018)
  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:726)
  at org.elegosproject.romupdater.DownloadPackage.checkHttpFile(DownloadPackage.java:50)
  at org.elegosproject.romupdater.JSONParser.checkRepository(JSONParser.java:52)
  at org.elegosproject.romupdater.VersionsList.onCreate(VersionsList.java:85)
  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1703)
  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1765)
  at android.app.ActivityThread.access$1500(ActivityThread.java:123)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:936)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:123)
  at android.app.ActivityThread.main(ActivityThread.java:3809)
  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:839)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  at dalvik.system.NativeStart.main(Native Method)

"Binder Thread #2" prio=5 tid=8 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x40513a78 self=0x172880
  | sysTid=1097 nice=0 sched=0/0 cgrp=default handle=609792
  | schedstat=( 11352537 45776369 17 )
  at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=7 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x40512a58 self=0x153170
  | sysTid=1096 nice=0 sched=0/0 cgrp=default handle=1207560
  | schedstat=( 11505125 17364505 14 )
  at dalvik.system.NativeStart.run(Native Method)

"Compiler" daemon prio=5 tid=6 VMWAIT
  | group="system" sCount=1 dsCount=0 obj=0x405100b0 self=0x8f840
  | sysTid=1095 nice=0 sched=0/0 cgrp=default handle=1255920
  | schedstat=( 90545653 26123051 207 )
  at dalvik.system.NativeStart.run(Native Method)

"JDWP" daemon prio=5 tid=5 VMWAIT
  | group="system" sCount=1 dsCount=0 obj=0x40510000 self=0x16ff38
  | sysTid=1094 nice=0 sched=0/0 cgrp=default handle=1193960
  | schedstat=( 1495363 18859862 8 )
  at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=4 RUNNABLE
  | group="system" sCount=0 dsCount=0 obj=0x4050ff40 self=0x8ede0
  | sysTid=1093 nice=0 sched=0/0 cgrp=default handle=1260696
  | schedstat=( 5096438 5187986 10 )
  at dalvik.system.NativeStart.run(Native Method)

"GC" daemon prio=5 tid=3 VMWAIT
  | group="system" sCount=1 dsCount=0 obj=0x4050fe98 self=0x16e4a0
  | sysTid=1092 nice=0 sched=0/0 cgrp=default handle=1208352
  | schedstat=( 1129150 15106201 4 )
  at dalvik.system.NativeStart.run(Native Method)

"HeapWorker" daemon prio=5 tid=2 VMWAIT
  | group="system" sCount=1 dsCount=0 obj=0x4050fdf8 self=0x8f6b8
  | sysTid=1091 nice=0 sched=0/0 cgrp=default handle=517184
  | schedstat=( 27221680 57983398 10 )
  at dalvik.system.NativeStart.run(Native Method)

Offline JD

  • Amministratore
  • Utente storico
  • *****
  • Post: 1600
  • Respect: +232
    • leinardi
    • Mostra profilo
  • Dispositivo Android:
    LG Nexus 5
  • Sistema operativo:
    L'ultima Ubuntu
Re:Problema della mia applicazione o dell'utente? (ANR keyDispatchingTimedOut)
« Risposta #1 il: 29 Gennaio 2011, 14:00:55 CET »
0
Ad occhio dovrebbe essere sufficiente eseguire quelle operazioni in un thread separato in modo da non bloccare l'UI e quindi generare un Application Not Responding...


performance - Android - how do I investigate an ANR? - Stack Overflow
Painless Threading | Android Developers
Designing for Responsiveness | Android Developers
« Ultima modifica: 29 Gennaio 2011, 14:02:30 CET da JD »
È stata trovata una soluzione al tuo problema?
Evidenzia il post più utile premendo . È un ottimo modo per ringraziare chi ti ha aiutato ;).
E se hai aperto tu il thread marcalo come risolto cliccando !

Offline nemina

  • Nuovo arrivato
  • *
  • Post: 23
  • Respect: 0
    • Mostra profilo
  • Dispositivo Android:
    Galaxy SII
Re:Problema ANR keyDispatchingTimedOut
« Risposta #2 il: 12 Marzo 2012, 20:29:57 CET »
0
Anche nella mia consolle nella mia app mi da come errore: ANR keyDispatchingTimedOut

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=0x4002a1a0 self=0xcef8
  | sysTid=223 nice=0 sched=0/0 cgrp=default handle=-1345006496
  at com.android.server.SystemServer.init1(Native Method)
  at com.android.server.SystemServer.main(SystemServer.java:640)
  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:864)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
  at dalvik.system.NativeStart.main(Native Method)

"Binder Thread #10" prio=5 tid=51 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x4082df08 self=0x442fb8
  | sysTid=975 nice=0 sched=0/0 cgrp=default handle=3855456
  at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #9" prio=5 tid=50 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x408d5368 self=0x40f640
  | sysTid=583 nice=0 sched=0/0 cgrp=default handle=4195416
  at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #8" prio=5 tid=49 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x408d4780 self=0x413b20
  | sysTid=582 nice=0 sched=0/0 cgrp=default handle=4195352
  at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #7" prio=5 tid=48 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x408cff70 self=0x3ff540
  | sysTid=581 nice=0 sched=0/0 cgrp=default handle=3543912
  at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #6" prio=5 tid=47 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x408cf968 self=0x40fbd0
  | sysTid=580 nice=0 sched=0/0 cgrp=default handle=4553488
  at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #5" prio=5 tid=46 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x40818830 self=0x33de38
  | sysTid=403 nice=0 sched=0/0 cgrp=default handle=3399072
  at dalvik.system.NativeStart.run(Native Method)

"pool-1-thread-1" prio=5 tid=45 WAIT
  | group="main" sCount=1 dsCount=0 obj=0x4079fd30 self=0x214368
  | sysTid=396 nice=0 sched=0/0 cgrp=default handle=3390240
  at java.lang.Object.wait(Native Method)
  - waiting on <0x4078c1c0> (a java.lang.VMThread)
  at java.lang.Thread.parkFor(Thread.java:1424)
  at java.lang.LangAccessImpl.parkFor(LangAccessImpl.java:48)
  at sun.misc.Unsafe.park(Unsafe.java:337)
  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2016)
  at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:411)
  at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1021)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1081)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
  at java.lang.Thread.run(Thread.java:1019)

"Binder Thread #4" prio=5 tid=44 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x405b1a48 self=0x2282f0
  | sysTid=393 nice=0 sched=0/0 cgrp=default handle=2970496
  at dalvik.system.NativeStart.run(Native Method)

"GpsLocationProvider" prio=5 tid=43 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x40826450 self=0x315328
  | sysTid=366 nice=10 sched=0/0 cgrp=bg_non_interactive handle=3232864
  at android.os.MessageQueue.nativePollOnce(Native Method)
  at android.os.MessageQueue.next(MessageQueue.java:119)
  at android.os.Looper.loop(Looper.java:117)
  at com.android.server.location.GpsLocationProvider$GpsLocationProviderThread.run(GpsLocationProvider.java:1965)

"loc_api" prio=5 tid=42 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x40822f58 self=0x3144d8
  | sysTid=362 nice=0 sched=0/0 cgrp=default handle=3110584
  at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #3" prio=5 tid=41 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x407af500 self=0x2a6300
  | sysTid=340 nice=0 sched=0/0 cgrp=default handle=2263280
  at dalvik.system.NativeStart.run(Native Method)

"RefQueueWorker@org.apache.http.impl.conn.tsccm.ConnPoolByRoute@40795c28" daemon prio=5 tid=40 WAIT
  | group="main" sCount=1 dsCount=0 obj=0x407a5240 self=0x2d5920
  | sysTid=330 nice=0 sched=0/0 cgrp=default handle=2972248
  at java.lang.Object.wait(Native Method)
  - waiting on <0x4079ef08> (a java.lang.ref.ReferenceQueue)
  at java.lang.Object.wait(Object.java:395)
  at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:107)
  at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:80)
  at org.apache.http.impl.conn.tsccm.RefQueueWorker.run(RefQueueWorker.java:102)
  at java.lang.Thread.run(Thread.java:1019)

"android.hardware.SensorManager$SensorThread" prio=5 tid=39 SUSPENDED
  | group="main" sCount=1 dsCount=0 obj=0x407a3868 self=0x2d5650
  | sysTid=329 nice=-8 sched=0/0 cgrp=default handle=2971528
  at android.hardware.SensorManager.sensors_data_poll(Native Method)
  at android.hardware.SensorManager$SensorThread$SensorThreadRunnable.run(SensorManager.java:446)
  at java.lang.Thread.run(Thread.java:1019)

"ThrottleService" prio=5 tid=38 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x406945d8 self=0x20d500
  | sysTid=303 nice=0 sched=0/0 cgrp=default handle=2152032
  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)

"LocationManagerService" prio=5 tid=37 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x406203a8 self=0x2a01e0
  | sysTid=301 nice=10 sched=0/0 cgrp=bg_non_interactive handle=2753304
  at android.os.MessageQueue.nativePollOnce(Native Method)
  at android.os.MessageQueue.next(MessageQueue.java:119)
  at android.os.Looper.loop(Looper.java:117)
  at com.android.server.LocationManagerService.run(LocationManagerService.java:556)
  at java.lang.Thread.run(Thread.java:1019)

"watchdog" prio=5 tid=36 TIMED_WAIT
  | group="main" sCount=1 dsCount=0 obj=0x40521e18 self=0x1fe408
  | sysTid=294 nice=0 sched=0/0 cgrp=default handle=2125496
  at java.lang.Object.wait(Native Method)
  - waiting on <0x40521e18> (a com.android.server.Watchdog)
  at java.lang.Object.wait(Object.java:395)
  at com.android.server.Watchdog.run(Watchdog.java:491)

"backup" prio=5 tid=35 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x407d0bc0 self=0xed388
  | sysTid=283 nice=10 sched=0/0 cgrp=bg_non_interactive handle=983576
  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)

"SoundPool" prio=5 tid=34 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x4067ff20 self=0x2a8a38
  | sysTid=277 nice=0 sched=0/0 cgrp=default handle=2785032
  at dalvik.system.NativeStart.run(Native Method)

"SoundPoolThread" prio=5 tid=33 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x40788108 self=0x2a8070
  | sysTid=278 nice=0 sched=0/0 cgrp=default handle=2785264
  at dalvik.system.NativeStart.run(Native Method)

"AudioService" prio=5 tid=32 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x40737698 self=0x2a6c20
  | sysTid=276 nice=0 sched=0/0 cgrp=default handle=2780504
  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.media.AudioService$AudioSystemThread.run(AudioService.java:1532)

"VoldConnector" prio=5 tid=31 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x407274a0 self=0x29dbb0
  | sysTid=274 nice=0 sched=0/0 cgrp=default handle=2743528
  at android.net.LocalSocketImpl.readba_native(Native Method)
  at android.net.LocalSocketImpl.access$400(LocalSocketImpl.java:29)
  at android.net.LocalSocketImpl$SocketInputStream.read(LocalSocketImpl.java:92)
  at com.android.server.NativeDaemonConnector.listenToSocket(NativeDaemonConnector.java:109)
  at com.android.server.NativeDaemonConnector.run(NativeDaemonConnector.java:83)
  at java.lang.Thread.run(Thread.java:1019)

"MountService" prio=5 tid=30 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x40765c90 self=0x29d0f0
  | sysTid=273 nice=0 sched=0/0 cgrp=default handle=2740776
  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)

"Tethering" prio=5 tid=29 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x407419f8 self=0x29bce8
  | sysTid=272 nice=0 sched=0/0 cgrp=default handle=2735648
  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)

"WifiService" prio=5 tid=28 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x4071dc08 self=0x29acf8
  | sysTid=271 nice=0 sched=0/0 cgrp=default handle=2731568
  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)

"ConnectivityThread" prio=5 tid=27 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x406250c0 self=0x299078
  | sysTid=269 nice=0 sched=0/0 cgrp=default handle=2724272
  at android.os.MessageQueue.nativePollOnce(Native Method)
  at android.os.MessageQueue.next(MessageQueue.java:119)
  at android.os.Looper.loop(Looper.java:117)
  at com.android.server.ConnectivityService$ConnectivityThread.run(ConnectivityService.java:237)

"NetdConnector" prio=5 tid=26 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x40631dc8 self=0x2985c0
  | sysTid=268 nice=0 sched=0/0 cgrp=default handle=2720776
  at android.net.LocalSocketImpl.readba_native(Native Method)
  at android.net.LocalSocketImpl.access$400(LocalSocketImpl.java:29)
  at android.net.LocalSocketImpl$SocketInputStream.read(LocalSocketImpl.java:92)
  at com.android.server.NativeDaemonConnector.listenToSocket(NativeDaemonConnector.java:109)
  at com.android.server.NativeDaemonConnector.run(Nat...

Offline bradipao

  • Moderatore globale
  • Utente storico
  • *****
  • Post: 4043
  • keep it simple
  • Respect: +567
    • Github
    • Google+
    • bradipao
    • Mostra profilo
  • Dispositivo Android:
    Nexus 5
  • Play Store ID:
    Bradipao
  • Sistema operativo:
    W7
Re:Problema della mia applicazione o dell'utente? (ANR keyDispatchingTimedOut)
« Risposta #3 il: 12 Marzo 2012, 20:47:19 CET »
0
Difficile dire la causa senza sapere niente del codice.

Posso solo dirti che una delle possibili cause di questo errore è mettere troppo codice (o codice che ci mette molto ad essere eseguito) all'interno di un handler tipo onTouchEvent(). Praticamente generando un evento touch, android richiama la tua onTouchEvent(), se l'esecuzione rimane dentro questa funzione per troppi secondi, viene generato un errore del genere.

Quale potrebbe essere nel tuo caso l'handler problematico non saprei, qualcosa sulla rete o sul gps.
NON rispondo a domande nei messaggi privati
Bradipao @ Play Store

Offline nemina

  • Nuovo arrivato
  • *
  • Post: 23
  • Respect: 0
    • Mostra profilo
  • Dispositivo Android:
    Galaxy SII
Re:Problema della mia applicazione o dell'utente? (ANR keyDispatchingTimedOut)
« Risposta #4 il: 12 Marzo 2012, 20:52:55 CET »
0
nella mia app c'è pubblicita con mobpartner...forse è questo codice che blocca??? booh...

Offline DarnellNajanReed

  • Utente normale
  • ***
  • Post: 359
  • Respect: +49
    • Google+
    • Mostra profilo
  • Dispositivo Android:
    LG Optimus One, Acer Iconia A500/501, Asus Transformer Prime, Galaxy ACE, Galaxy S Plus, Galaxy S Advance P, Galaxy Tab 2 7.0, Google Nexus 7
  • Play Store ID:
    Luigi Notaro
  • Sistema operativo:
    OS X 10.8.3
Re:Problema della mia applicazione o dell'utente? (ANR keyDispatchingTimedOut)
« Risposta #5 il: 12 Marzo 2012, 21:37:31 CET »
0
É possibile che tu abbia inserito il codice di "recupero" dell'ad sul main thread (quello che controlla la UI)?