第一番 Android 不能进行debug调试

0.关键字

  • android 无法debug ; android debug不好使; android 不能debug

1.问题描述

Error running app:

  • Cannot debug application from module app on device huawei-gem_703l-N7M6R15426003899.
  • 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.
Image.png

2.解决办法:

(stackoverflow 还是相当靠谱的啊 )

在面板中点击 Build Variants 找到想要debug的Model,将此Model后面Build Variants的 release 修改为debug ,等待重新build之后,就可以进行正常的debug了,如下图:

Image.png

3.补充说明

(1) 如果在gradle中配置过渠道包,在Build Variants中会有很多选项,看一下正在使用的是否带有release后缀 如果有则选择相应的debug,如下图:

Image.png

(2) 如果在Android Studio 面板中没有 Build Variants 则按下面步骤进行,即可调出此面板,如下图:

Image.png

The End


若此文有幸被您看到,欢迎指正(づ ̄ 3 ̄)づ

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,420评论 25 708
  • Correctness AdapterViewChildren Summary: AdapterViews can...
    MarcusMa阅读 8,925评论 0 6
  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,568评论 2 45
  • 读万卷书不如行万里路,行万里路不如阅人无数,阅人无数不如思索回顾。
    母亲河畔那棵小草阅读 95评论 0 0
  • 热,实际上是对有夏季的高温极端形象化地概括。略猜“热”的字形,执手参与降温,依旧能掉四滴水,想来古人造字时也挥汗如...
    Xiaoyuzhixing阅读 188评论 0 1