In Android Studio 2.0, Cannot find local variable of method in debug mode

后端 未结 7 2049
轻奢々
轻奢々 2021-01-07 18:17

After Updating the android version 1.5 to 2.0 Preview4. Android studio Debugger unable to find the local variable defined in method definition. For reference, find the below

相关标签:
7条回答
  • 2021-01-07 18:20

    Make sure you are not building a 'Release' Build Variant. You will get above warning when it is a Release Build.

    0 讨论(0)
  • 2021-01-07 18:20

    Disable jack for debug build type (build.gradle):

    buildTypes {
        ...
        debug {
            jackOptions {
                enabled false
            }
        }
    }
    

    Note: 1.8 source compatibility requires jack!

    0 讨论(0)
  • 2021-01-07 18:23

    In your gradle, do you enable test coverage ?

    buildTypes {
            debug {
                testCoverageEnabled = true
            }
        }
    

    Set testCoverageEnabled = false , it fixed the issue. https://code.google.com/p/android/issues/detail?id=78045

    0 讨论(0)
  • 2021-01-07 18:30

    I got the problem , it was in build.gradle file

    buildTypes { debug{ minifyEnabled true //This was the problem , make it false

        }
        release{
    
        }
    }
    
    0 讨论(0)
  • 2021-01-07 18:38

    if you have minifyEnabled true in

    debug { minifyEnabled true debuggable true }

    remove that and using just like that debug { debuggable true }

    its work for me

    0 讨论(0)
  • 2021-01-07 18:42

    You can try this solution - open the Android Device Monitor, do a 'Reset adb'.

    A screenshot where to find 'Reset adb'.

    A screenshot where to find 'Reset adb'

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