Android Studio 2.1 debugger does not show local variables

4ndro1d picture 4ndro1d · May 10, 2016 · Viewed 16.2k times · Source

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?

enter image description here

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:

The problem remains when using USB debugging. No local variables are visible, not even when trying to evaluate expressions while debugging:

enter image description here

Android Studio 2.1, Gradle 2.1.0, Java 1.8

Answer

vasquez picture vasquez · Dec 14, 2016

Had the same problem.

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

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

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