Android Studio 2.1 debugger does not show local variables

后端 未结 9 1499
野趣味
野趣味 2021-01-01 12:25

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 exe

相关标签:
9条回答
  • 2021-01-01 12:26

    I tried setting testCoverageEnabled to false but that did not work for me. In my case, I had ProGuard enabled for my debug flavor and disabling it (i.e. setting minifiyEnabled to false) was the only thing that allowed me to be able to see my local variables while debugging again.

    0 讨论(0)
  • 2021-01-01 12:28

    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
            }
        }
    }
    
    0 讨论(0)
  • 2021-01-01 12:35

    I had same trouble. I completely reinstalled my IDE and the trouble has been disappeared. I hope my approach will help you.

    0 讨论(0)
  • 2021-01-01 12:36

    In my case, it was because I had forgotten that my build variant was set to release. Toggling the variant back to debug and re-running correctly showed the local variables.

    0 讨论(0)
  • 2021-01-01 12:41

    After a while of figuring out this same issue, I realized I was running a release build rather than a debug build.

    The build variants window may not be open in Android Studio by default. Go to Tool Windows -> Build Variants. In the Build Variants window, select the appropriate build.

    In your app.gradle file, make sure debuggable is set to true in the build variant you would like to debug:

    android {
    
       // ...
    
       buildTypes {
    
          release {
             // ...
          }
    
          debug {
             debuggable true
          }
    
       }
    
       // ...
    
    }
    

    If you would like to debug your release build, go ahead and add debuggable true to your release build.

    Hope this helps!

    0 讨论(0)
  • 2021-01-01 12:44

    I tried some kind of hit n trial and made it work with the settings as seen in the attachment. FYI, using latest version of Android Studio 3.3.1 and gradle version 4.6.

    0 讨论(0)
提交回复
热议问题