Android Studio - Slow debug, sometimes stuck on “Waiting for debugger”, SIGSEGV crashes

橙三吉。 提交于 2019-12-22 05:57:08

问题


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:

  1. Very slow debugging overall. Stepping over is a drag.
  2. A high precentage of failed debugger connection attempts, where the device is hanging on "Waiting for debugger".
  3. 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.
  4. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!