调试:Android Studio 导致应用程序崩溃,当跨步退出方法时 [英] Debugging: Android studio causes app to crash, when stepping over to exit a method

查看:115
本文介绍了调试:Android Studio 导致应用程序崩溃,当跨步退出方法时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 Android Studio 2.1.1 并在两台设备上调试我的应用程序(一个模拟器在我的 x86_64 windows 10 上,另一个是我的 HTC One M8).在调试期间,如果我跳过代码,并且当它存在当前方法或作用域时,程序就会崩溃,在 logcat 中没有任何指示(我知道这一点是因为我故意添加了一个 log.d 作为最后一行,最后我得到的消息是崩溃前这个 log.d 的内容).

I am running Android Studio 2.1.1 and debugging my app on two devices (one emulator on my x86_64 windows 10, the other is my HTC One M8). During debugging, if I step over codes, and when it exists the current method or scope, the program just crashes, without any indication in logcat (I know this because I purposely added a log.d to be the last line, and the last message I got is the content from this log.d before crashing).

但是,如果我使用 continue 而不是 step over,应用程序只会正常退出当前功能,而不会导致应用程序崩溃.

However, if I use continue rather than step over, the app just exits the current function fine, without crashing the app.

我不知道这里发生了什么,它大大减慢了我的开发和调试速度.任何想法和建议将不胜感激.如果您需要更多信息,请告诉我,提前致谢.

I have no idea what is going on here, it drastically slows down my development and debugging. Any ideas and suggestions will be appreciated. Please let me know if you need more info, thanks in advance.

推荐答案

我遇到了类似的问题.然而,在网上闲逛,我发现了这一点:

I'm having a similar issue. However, poking around online, I found this:

https://code.google.com/p/android/问题/详细信息?id=200880

  • 这是一个已知问题,仅影响 Android 6 (Marshmallow) 设备和模拟器.
  • 没有解决方法,只能使用 Android 4/5/7 设备进行调试,或者使用继续"而不是跳过".
  • It's a known issue that affects Android 6 (Marshmallow) devices and emulators only.
  • There is no workaround, except to use an Android 4/5/7 device for debugging, or to use 'Continue' instead of 'Step Over'.

如果有人找到修复/解决方法,那将会很有帮助!

If anyone finds a fix/workaround, it would be helpful!

这篇关于调试:Android Studio 导致应用程序崩溃,当跨步退出方法时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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