Cannot debug application from module app on device

来源:互联网 发布:java中方法的返回值 编辑:程序博客网 时间:2024/06/16 18:24

可以运行但不能开启debug模式

Error running app: Cannot debug application from module app on device xiaomi-mi_4lte-347a4d71. This application does not have the debuggable attribute enabled in its manifest. If you have manually set it in the manifest, then remove it and let the IDE automatically assign it. If you are using Gradle, make sure that your current variant is debuggable.

解决方法: 加上 debuggable true

 buildTypes {    release {        //  TODO:打正式包时记得关掉        debuggable true        minifyEnabled false        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'        signingConfig signingConfigs.config    }}