我正在使用Android Studio 2.1.3和gradle开发一个Android应用程序.
问题是,一个简单方法中的断点永远不会被命中,尽管它必须被命中,因为在应用程序调试期间满足条件.
首先,我认为问题与此问题的答案中描述的问题有关:
使用gradle构建库项目时,BuildConfig.DEBUG始终为false
为了测试这一点,我删除了库项目并将所有源代码集成到主app模块中.它什么都没解决.需要注意的是,以下是build.gradle,其中对于调试/发布,minify设置为false:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.mycompany.mymobileapp"
minSdkVersion 21
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable true
jniDebuggable true
renderscriptDebuggable true
zipAlignEnabled false
}
debug {
debuggable true
minifyEnabled false
zipAlignEnabled false
jniDebuggable true
renderscriptDebuggable true
}
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.0.5-beta'
testCompile 'com.android.support:support-v4:23.1.1'
testCompile 'org.powermock:powermock-api-mockito:1.6.2' …
Run Code Online (Sandbox Code Playgroud)debugging android breakpoints android-studio android-gradle-plugin