Android debuggable=true with proguard is on

android, ant, proguard

Solution

Ran into the exactly same problem. Luckily Google helped me out.

Now my `build.gradle`:

// ...
android {
    // ...
    buildTypes {
        debug {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                    'proguard-rules.txt',
                    'proguard-rules.debug.txt'
            debuggable true
        }
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                    'proguard-rules.txt'
        }
    }
}

`proguard-rules.debug.txt`:

-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
-dontobfuscate
-dontoptimize
-dontpreverify

Worked for me. Hope it helps. ;-)

Problem

As my project is too large, I need to run proguard in order to compile android successfully. But when I set android:debuggable="true" in order for me to debug easily, it turn off proguard automatically. Is there any solution or workaround? Thank You

Original source