问题
This may come out as too broad a question, but this issue(s) is driving me nuts and I'd appreciate some help:
It seems that with each new Android Studio version, debugging gets more and more impossible. I'm experiencing the following issues:
- Very slow debugging overall. Stepping over is a drag.
- A high precentage of failed debugger connection attempts, where the device is hanging on "Waiting for debugger".
- SIGSEGV "crashes", where the debugger would halt on a SIGSEGV on a random place (ususally right after launch) but I'd be able to click the play button and continue debugging.
- Debugger disconnections.
This happens both on real devices and emulators, with a wide range of setups and Android API levels.
My rig is quite powerful: Win 10, I7-4810MQ, 16g mem, SSD. Current AS version is 2.3.3.
Can anyone help me make some sense out of this mess?
回答1:
It turns out the culprit was me using JDK 8 (1.8.0_45). I guess the situation did indeed begin deteriorating with Android Studio 2.2, when Google made the switch to OpenJDK.
The fix was to simply let Android Studio use its own JRE, which is based on the OpenJDK project.
In File -> Project structure -> SDK location, I had to tick Use embedded JDK:
Now I have to deal with the actual bugs in my app, but this is a whole different story...
来源:https://stackoverflow.com/questions/46667885/android-studio-slow-debug-sometimes-stuck-on-waiting-for-debugger-sigsegv