Android studio 设置了断点,但是开始调试后,看到的却是一个带×的断点

Warning: No executable code found at line 482 in class com.xx.xx.  

1、所有的断点都是带×的

参考:http://stackoverflow.com/questions/21743442/cant-reach-some-lines-debugging-android-app

http://stackoverflow.com/questions/20097709/android-studio-omits-breakpoints

http://stackoverflow.com/questions/28836243/android-studios-debugger-not-stopping-at-breakpoints-within-library-modules

在module的build.gradle中设置minifyEnabled 为false

buildTypes {    release {        minifyEnabled true        shrinkResources true        proguardFiles getDefaultProguardFile('proguard-android.txt')        signingConfig signingConfigs.release    }    debug {        debuggable true        minifyEnabled false //这是关键的,我的问题就是出在这里        proguardFiles getDefaultProguardFile('proguard-android.txt')        signingConfig signingConfigs.release    }}

如果还想使用代码混淆,还想可以断点调试正常,可是参见这里的smoothumut的回答,博主未验证是否可行

2、若只是个别地方,显示带×的断点

参考:http://stackoverflow.com/questions/11591662/cannot-set-java-breakpoint-in-intellij-idea

http://blog.csdn.net/lihenair/article/details/48975269

I had similar problems and various attempts has been applied. Below is my usual steps:

  1. If you are using Maven dependencies, go to Maven Projects -> refresh
  2. If that does not work, Try top menu –> Build –> Rebuild Project
  3. If that still doesn’t work, try top menu –> File –> Invalidate Cache/Restart
  4. If that still doesn’t work, then $CATALINA_BASE/bin/catalina.sh stop, then start

After this, usually it covers 99% of the problems. Otherwise, Probably you will have to examine some other possibilities.

2和3两个步骤可以解决问题,若不行再尝试全部步骤

3、真机调试,第一个断点正常,第2个断点显示带×

参考:http://stackoverflow.com/questions/20097709/android-studio-omits-breakpoints

http://stackoverflow.com/questions/20179748/the-first-line-breakpoint-works-only/20203066#20203066

切换ART为Dalvik ,切换步骤请查看这里

更多相关文章

  1. android sdk支持ant自动构建jar步骤
  2. Android集成腾讯bugly-tinker热更新使用步骤
  3. Android之开发BLE 详细步骤
  4. Android在任何地方模拟点击屏幕
  5. Android之断点续传下载
  6. Android 断点续传
  7. android学习笔记----多线程断点续传下载原理设计
  8. Android编译环境搭建步骤(公司) - 写给自己

随机推荐

  1. Android投票自定义View
  2. android调用js
  3. Android实现定时刷新
  4. 【Android】Android SurfaceFlinger之Buf
  5. Android7关闭selinux(设置为Permissive模
  6. RN集成原生Android应用
  7. Android webkit 事件传递流程
  8. Android中用到了哪些设计模式?
  9. Android 基础知识复习
  10. Android使用腾讯X5内核替换原生webview