问题描述
我正在尝试通过Android Studio中的网络进行调试。我通过端口5555连接,通常可以逐步通过断点。但是执行一行代码通常要花几分钟,而另一件事是我看不到没有成员的任何变量。我所看到的只是 this
对象,但方法中没有变量。如何启用它?
I am trying to debug over network in Android Studio. I connected via port 5555 and generally it is possible step through break points. But it often takes minutes just to execute one line of code and the other thing is that I don't see any variables which are no members. All I see is the this
object, but no variables from within methods. How can I enable it?
您可以看到我在方法中,至少活动对象已初始化,但在变量监视器中不可见。
As you can see I am within the method and at least the activity object is initialized, but it is not visible in the variables monitor.
UPDATE:
使用USB调试时问题仍然存在。没有局部变量是可见的,即使在调试时尝试计算表达式也是如此:
The problem remains when using USB debugging. No local variables are visible, not even when trying to evaluate expressions while debugging:
Android Studio 2.1,Gradle 2.1.0,Java 1.8
Android Studio 2.1, Gradle 2.1.0, Java 1.8
推荐答案
遇到了同样的问题。
Android Studio中有一个错误,请参见
There is a bug in Android Studio, see https://code.google.com/p/android/issues/detail?id=93730
他们建议在构建中删除.gradle(应用程序),这对我来说已经解决了这个问题。
They recommend removing in build.gradle (app), this fixed the issue for me.
android {
buildTypes {
debug {
...
testCoverageEnabled true
}
}
}
这篇关于Android Studio 2.1调试器不显示局部变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!