I'm trying to debug my app in my phone but Android Studio can't see some parts of my code as executable with the warning:
No executable code found at line XX in class ...
Following is the image of the breakpoints, I try to debug line by line bug it just skips the lines with the X breakpoints. I tried to debug in eclipse and got the same behavior.
Using:
Is there a way to fix this?
try to disable code shrinking in your build.gradle file. it's located in your projects root directory. Under buildTypes, make sure minifyEnabled is set to false. should look something like this:
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt')
signingConfig signingConfigs.release
}
debug {
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt')
signingConfig signingConfigs.release
}
}
None of the answers from the many posts on this topic worked for me. I am using AndroidStudio2.
I had been running my code using the Debug 'app' (Shift+F9)
button ...
then I tried using the normal Run 'app' (Shift+F10)
button, followed by the Attach debugger to Android process
button, and all the red break point circles with x's turned to checks.
After I run
'd it that once, I went back to debug
ing it, and the break points continued to work correctly.
I faced the same issue while working on my project. I'm using Android Studio 2.0 and I solved the issue by cleaning the project.
Go to Build --> Clean project
Menu Run -> Clean and Rerun.
After building and deploying, start Debug again.
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