Migore Migore - 1 month ago 23
Android Question

Can't reach some lines debugging android app

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 ...

enter image description here

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:


  • Android Studio 0.4.2

  • LG G2

  • Android 4.2.2



Debugging

Is there a way to fix this?

Answer

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
    }
}
Comments