I'm trying to debug my application with the option Java Field Watchpoints
. My variable is found first time it appears in my code (its initialisation) but right after that I've got this error:
Cannot find local variable 'variableName'
and I can't follow its modifications then.
I've been searching around and modified my gradle file as this:
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
debuggable true
testCoverageEnabled = true
}
}
My active build variant is debug
(not release) so the error is not coming from here.
I am using Android Studio 3.6
Canary 11
Does anyone encounter the same problem?
Run and Debug view# To bring up the Run and Debug view, select the Run and Debug icon in the Activity Bar on the side of VS Code. You can also use the keyboard shortcut Ctrl+Shift+D.
To open the Locals window, while debugging, select Debug > Windows > Locals, or press Alt+4. This topic applies to Visual Studio on Windows.
Right-click the variable in the data tip, and select Add Watch. The variable appears in the Watch window. If your Visual Studio edition supports more than one Watch window, the variable appears in Watch 1.
The Locals will show local variables of the current scope. It usually starts with this , which represents the current class. The Autos window will show all variables used in the current line and in the previous line.
It could be a optimization by some part of the tool chain, like removing dead code, escape analysis, or indeed a bug in the runtime, see for some of the possibilities: https://www.guardsquare.com/en/blog/proguard-and-r8
Maybe unit testing your code and annotating it with debug logging will prove to be more successful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With