Android Studio 2.1 调试器不显示局部变量 [英] Android Studio 2.1 debugger does not show local variables

查看:80
本文介绍了Android Studio 2.1 调试器不显示局部变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 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.

更新:

使用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 有一个 bug,见 https://code.google.com/p/android/issues/detail?id=93730

There is a bug in Android Studio, see https://code.google.com/p/android/issues/detail?id=93730

他们建议在 build.gradle (app) 中删除,这为我解决了问题.

They recommend removing in build.gradle (app), this fixed the issue for me.

android {
    buildTypes {
        debug {
            ...
            testCoverageEnabled true
        }
    }
}

这篇关于Android Studio 2.1 调试器不显示局部变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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