my technology blog

Android Studio不能进行debug调试问题

阅读:758 创建时间:17-01-13 23:45:35 tags:android,bug

Android Studio不能进行debug调试问题

  • 有时升级了studio或升级了gradle版本会出现这样的提示:

    Cannot debug application from module app on device xxx 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.

  • 出现的原因是配置不正确

  • 解决办法有以下几种:
  • 在面板中点击 Build Variants (如果找不到,可以这样选择:menu-view-tool windows-Build Variants) 找到想要debug的Model,将此Model后面Build Variants的 release 修改为debug ,等待重新build之后,就可以进行正常的debug了。
  • 添加标签

  • 修改gradle文件

    buildTypes { release { .... } debug { debuggable true } }