Aplikacja na Androida zawiesza się po uruchomieniu w trybie debugowania

Gdy uruchamiam się w trybie debug Aplikacja ulega awarii, ale gdy uruchamiam ją normalnie działa. Myślę, że problem pojawia się, gdy dołączony jest debugger.

Log:

A/art: art/runtime/jdwp/jdwp_event.cc:661] Check failed: Thread::Current() != GetDebugThread() (Thread::Current()=0x7f44a18400, GetDebugThread()=0x7f44a18400) Expected event thread
A/art: art/runtime/runtime.cc:422] Runtime aborting...
A/art: art/runtime/runtime.cc:422] Aborting thread:
A/art: art/runtime/runtime.cc:422] "JDWP" prio=5 tid=4 WaitingForDebuggerSend
A/art: art/runtime/runtime.cc:422]   | group="" sCount=0 dsCount=0 obj=0x12c60280 self=0x7f44a18400
A/art: art/runtime/runtime.cc:422]   | sysTid=24137 nice=0 cgrp=default sched=0/0 handle=0x7f4b904450
A/art: art/runtime/runtime.cc:422]   | state=R schedstat=( 132066712 16401043 106 ) utm=9 stm=2 core=3 HZ=100
A/art: art/runtime/runtime.cc:422]   | stack=0x7f4b80a000-0x7f4b80c000 stackSize=1005KB
A/art: art/runtime/runtime.cc:422]   | held mutexes= "abort lock"
A/art: art/runtime/runtime.cc:422]   native: #00 pc 000000000047e2cc  /system/lib64/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+220)
A/art: art/runtime/runtime.cc:422]   native: #01 pc 000000000047e2c8  /system/lib64/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+216)
A/art: art/runtime/runtime.cc:422]   native: #02 pc 0000000000452434  /system/lib64/libart.so (_ZNK3art6Thread9DumpStackERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMap+480)
A/art: art/runtime/runtime.cc:422]   native: #03 pc 00000000004403ac  /system/lib64/libart.so (_ZNK3art10AbortState10DumpThreadERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPNS_6ThreadE+56)
A/art: art/runtime/runtime.cc:422]   native: #04 pc 0000000000440228  /system/lib64/libart.so (_ZNK3art10AbortState4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+668)
A/art: art/runtime/runtime.cc:422]   native: #05 pc 0000000000433bfc  /system/lib64/libart.so (_ZN3art7Runtime5AbortEPKc+148)
A/art: art/runtime/runtime.cc:422]   native: #06 pc 00000000000e597c  /system/lib64/libart.so (_ZN3art10LogMessageD2Ev+1592)
A/art: art/runtime/runtime.cc:422]   native: #07 pc 00000000002f8458  /system/lib64/libart.so (_ZN3art4JDWP9JdwpState24AcquireJdwpTokenForEventEm+624)
A/art: art/runtime/runtime.cc:422]   native: #08 pc 00000000002f7b1c  /system/lib64/libart.so (_ZN3art4JDWP9JdwpState29SendRequestAndPossiblySuspendEPNS0_9ExpandBufENS0_17JdwpSuspendPolicyEm+248)
A/art: art/runtime/runtime.cc:422]   native: #09 pc 00000000002fcb08  /system/lib64/libart.so (_ZN3art4JDWP9JdwpState16PostClassPrepareEPNS_6mirror5ClassE+1380)
A/art: art/runtime/runtime.cc:422]   native: #10 pc 0000000000124a9c  /system/lib64/libart.so (_ZN3art11ClassLinker11DefineClassEPNS_6ThreadEPKcmNS_6HandleINS_6mirror11ClassLoaderEEERKNS_7DexFileERKNS9_8ClassDefE+804)
A/art: art/runtime/runtime.cc:422]   native: #11 pc 0000000000381d04  /system/lib64/libart.so (_ZN3artL25DexFile_defineClassNativeEP7_JNIEnvP7_jclassP8_jstringP8_jobjectS7_S7_+344)
A/art: art/runtime/runtime.cc:422]   native: #12 pc 00000000001dd40c  /system/framework/arm64/boot-core-libart.oat (???)
A/art: art/runtime/runtime.cc:422]   at dalvik.system.DexFile.defineClassNative(Native method)
A/art: art/runtime/runtime.cc:422]   at dalvik.system.DexFile.defineClass(DexFile.java:296)
A/art: art/runtime/runtime.cc:422]   at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:289)
A/art: art/runtime/runtime.cc:422]   at dalvik.system.DexPathList.findClass(DexPathList.java:418)
A/art: art/runtime/runtime.cc:422]   at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
A/art: art/runtime/runtime.cc:422]   at com.android.tools.fd.runtime.IncrementalClassLoader$DelegateClassLoader.findClass(IncrementalClassLoader.java:90)
A/art: art/runtime/runtime.cc:422]   at com.android.tools.fd.runtime.IncrementalClassLoader.findClass(IncrementalClassLoader.java:62)
A/art: art/runtime/runtime.cc:422]   at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
A/art: art/runtime/runtime.cc:422]   at java.lang.ClassLoader.loadClass(ClassLoader.java:367)
A/art: art/runtime/runtime.cc:422]   at java.lang.ClassLoader.loadClass(ClassLoader.java:367)
A/art: art/runtime/runtime.cc:422]   at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
A/art: art/runtime/runtime.cc:422] Dumping all threads without appropriate locks held: thread list lock mutator lock
Author: Sebastian, 2016-11-15

13 answers

Dla mnie miało to miejsce, gdy mam punkt przerwania w zagnieżdżonej funkcji. W moim przypadku było w zasięgu ręki.run () {}. Nie wiem, czy dzieje się to w innych zagnieżdżonych funkcjach.

Przykład:

public class TouchEvent {
    public boolean HandleEvent(MotionEvent Event) {
        new Runnable() { @Override public void run() {
            int i=5;
            i++;
        }};
    }
}

Jeśli w dowolnej linii wewnątrz Func run() znajduje się punkt przerwania, ulega on awarii z błędem A/art: art/runtime/jdwp/jdwp_event.cc:661] Check failed: Thread::Current() != GetDebugThread() (Thread::Current()=0x########, GetDebugThread()=0x########) Expected event thread .

Ten błąd występuje przy pierwszym napotkaniu klasy, A nie przy trafieniu punktu przerwania. Tak się stało, gdy wszedłem do linii, która miała new TouchEvent();, przed którymkolwiek z TouchEvent ' s kod został uruchomiony (przed konstruktorem).

Rozwiązaniem jest usunięcie punktu przerwania (i umieszczenie go w innym miejscu).

Edit:

Zapomniałem wspomnieć, że wydaje się być powiązany z API25, ale zgłoszono go również dla API26 i API27.

Edit:

Innym rozwiązaniem jest wyłączenie Instant Run , ale proszę dać kredyt toobsco42 poniżej.

 281
Author: Dakusan,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2018-06-12 21:08:52

W moim przypadku musiałem wyłączyć Instant Run. Wydaje się, że Instant Run ma różnego rodzaju skutki uboczne i może to być jeden z nich.

 166
Author: toobsco42,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-01-11 09:48:11

Problem jest związany z Androidem w wersji 7.x, usunąłem wszystkie punkty przerwania w zagnieżdżonych funkcjach i działało, testowane z Androidem w wersji 6.0 też i działa bez problemu.

Według google developers team response, została ona ustalona na 12/1/2016 i będzie stosowana w następnej wersji.

 42
Author: hcknl,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-05-05 08:11:47

Usunąłem wszystkie punkty przerwania i działało, przetestowane z emulatora Pixel API 25.

Aby usunąć wszystkie punkty przerwania:

  • Przejdź do opcji Debugger.

  • Kliknij na czerwoną ikonę, która znajduje się poniżej, aby zatrzymać debugowanie.

  • Zobaczysz tam okno, w którym możesz usunąć wszystkie punkty przerwania.

Zobacz więcej w tym poście: https://stackoverflow.com/a/42478994/5749462

 20
Author: creonilso rodrigues,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-09-29 13:04:34

Jest to spowodowane pewnym problemem z punktami debugowania. Usuń wszystkie punkty debugowania, a następnie powinno działać.

 15
Author: flame3,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2018-01-15 10:45:04

Its really weird, I disabled Instant Run and the problem solved itself.

 6
Author: mbpakalin,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-08-15 08:52:21

Mój problem polegał na tym, że miałem breakpoint w instrukcji import

 3
Author: egorikem,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-09-08 11:40:41

Najprostszym rozwiązaniem jest próba znalezienia innego urządzenia lub emulatora (dzięki Avd Manager mamy wybór), które będzie działać jako urok bez obejść

 1
Author: yoAlex5,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2018-03-22 16:17:20

Tutaj wpisz opis obrazka

W oknie 5: Debug użyj przycisku "View Breakpoints"

Tutaj wpisz opis obrazka

Usuń zaznaczenie z nich

Tutaj wpisz opis obrazka

 1
Author: Nicoolasens,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2018-06-29 15:27:26

Usuwanie punktu przerwania z Runable.run() rozwiązał problem. Byłem w stanie użyć punktów przerwania w czasie wykonywania wewnątrz Runable.run (). Ale nie w czasie kompilacji

 0
Author: Ankush,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-06-12 06:55:23

Natknąłem się na ten sam problem, ale mój punkt przerwania był pierwszą linią zagnieżdżonej funkcji, więc jak go przenieść gdzie indziej?

Utworzyłem tymczasową metodę prywatną i wywołanie tej metody było pierwszą rzeczą w funkcji, a następnie ustawiłem punkt przerwania w tej metodzie.

Po zakończeniu debugowania usunąłem metodę i jej wywołanie.

 0
Author: roobyroo,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-08-24 15:31:24

Jest to strzał w ciemno, ale dla mnie, gdy mam instrukcję importu, która nie jest używana, a ten import ma kod, który uruchamia połączenia sieciowe, to zawiesił się dla mnie, ale po usunięciu go, kod był w stanie debugować normalnie.

 0
Author: reidisaki,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-11-08 16:30:36

Uruchamianie upaść tylko podczas uruchamiania z debuggera. Ponownie Uruchomiony Android Studio 2.3.2...ciągle się rozbijał. Działa dobrze w trybie Run. Włożyłam kłodę.d () zaraz po raz pierwszy...i to rozwiązało problem! Do dzieła!

 0
Author: IrvineCAGuy,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-11-14 21:01:38