无法达到某些线程调试Android应用程序 [英] Can't reach some lines debugging android app

查看:126
本文介绍了无法达到某些线程调试Android应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在手机中调试我的应用程序,但Android Studio无法看到我的代码的一些部分可执行,并附带警告:



无可执行代码在类中的第XX行找到





以下是断点的图像,我尝试逐行调试它只是跳过与X断点的线。我试图在eclipse中调试并得到相同的行为。



使用:




  • Android Studio 0.4.2

  • LG G2

  • Android 4.2.2





是有一种方法来解决这个问题?

解决方案

尝试在你的build.gradle文件中禁用代码缩小。它位于您的项目根目录。
在buildTypes下,确保minifyEnabled设置为false。应该看起来像这样:

  buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt')
签名配置signatureConfigs.release
}
调试{
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt')
签名配置signConfigs.release
}
}


I'm trying to debug my app in my phone but Android Studio can't see some parts of my code as executable with the warning:

No executable code found at line XX in class ...

Following is the image of the breakpoints, I try to debug line by line bug it just skips the lines with the X breakpoints. I tried to debug in eclipse and got the same behavior.

Using:

  • Android Studio 0.4.2
  • LG G2
  • Android 4.2.2

Is there a way to fix this?

解决方案

try to disable code shrinking in your build.gradle file. it's located in your projects root directory. Under buildTypes, make sure minifyEnabled is set to false. should look something like this:

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
    }
}

这篇关于无法达到某些线程调试Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆