Android Studio - 调试缓慢,有时卡在“等待调试器"上,SIGSEGV 崩溃 [英] Android Studio - Slow debug, sometimes stuck on "Waiting for debugger", SIGSEGV crashes

查看:44
本文介绍了Android Studio - 调试缓慢,有时卡在“等待调试器"上,SIGSEGV 崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个过于宽泛的问题,但这个问题让我发疯,我希望得到一些帮助:

似乎随着每个新的 Android Studio 版本,调试变得越来越不可能.我遇到以下问题:

  1. 整体调试速度非常慢.跨过去是一种拖累.
  2. 调试器连接尝试失败的概率很高,其中设备挂起等待调试器".
  3. SIGSEGV崩溃",调试器会在随机位置(通常在启动后立即)停止在 SIGSEGV 上,但我可以点击播放按钮并继续调试.
  4. 调试器断开连接.

这在真实设备和模拟器上都会发生,具有广泛的设置和 Android API 级别.

我的装备相当强大:Win 10、I7-4810MQ、16g mem、SSD.当前 AS 版本为 2.3.3.

谁能帮我弄清楚这个烂摊子?

解决方案

事实证明,罪魁祸首是我使用 JDK 8 (1.8.0_45).我猜 Android Studio 2.2 的情况确实开始恶化,当时谷歌

现在我必须处理我的应用程序中的实际错误,但这是一个完全不同的故事......

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?

解决方案

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...

这篇关于Android Studio - 调试缓慢,有时卡在“等待调试器"上,SIGSEGV 崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆