Android Studio - no debuggable applications

前端 未结 16 2232
遇见更好的自我
遇见更好的自我 2020-12-02 04:42

I tried to debug a release version of my Android application but Android Studio failed to attach a debugger. (It could not find Android procces of my running application).

16条回答
  •  有刺的猬
    2020-12-02 05:11

    The solution is to turn on debuggable flag (debuggable true) in application's gradle file:

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 19
        buildToolsVersion "20.0.0"
    
        defaultConfig {
            applicationId "org.example"
            minSdkVersion 14
            targetSdkVersion 19
            versionCode 1
            versionName "1.0"
        }
    
        buildTypes {
            debug {
                debuggable true
            }
        }
    }
    

    After Android Studio synced Gradle with project files and reinstalled an application, the debugging start working.

提交回复
热议问题