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 一直在最前面的浮动窗口效果
  2. popwindow动画显示消失,activity切换动画
  3. Android学习札记51:在TextView显示插入的图片
  4. android监控来电显示
  5. popwindow动画显示消失,activity切换动画
  6. 四十六、android中的Bitmap
  7. Android(安卓)imageView图片按比例缩放
  8. Android之TabHost
  9. popwindow动画显示消失,activity切换动画

随机推荐

  1. Android:自定义view实现动画
  2. Android 数据库 短信 监听
  3. android唤醒屏幕--保持屏幕唤醒-Reprinte
  4. Android如果对APK进行加密,提高反编译难度
  5. android 运行一个cp命令
  6. android 打开文件
  7. android AnimationSet
  8. List集合和LinkList的讲解
  9. Android(安卓)常驻进程保活自启动方案总
  10. 对Android应用进行单元测试