如果启用proguard,则无法确定任务':app:crashlyticsStoreDeobsDebug'的依赖关系 [英] Could not determine the dependencies of task ':app:crashlyticsStoreDeobsDebug' if I enable the proguard
问题描述
在Android Studio 2中运行应用程序时出现以下错误.
I get following error when I was running an app within Android Studio 2.
Gradle tasks [:app:assembleDebug]
Could not determine the dependencies of task ':app:crashlyticsStoreDeobsDebug'.
> Task with path 'dexDebug' not found in project ':app'.
BUILD FAILED
这是模块的build.gradle
Here is the build.gradle for module
buildscript {
repositories {
maven { url 'http://download.crashlytics.com/maven' }
maven { url "http://dl.bintray.com/populov/maven" }
}
dependencies {
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'crashlytics'
repositories {
maven { url 'http://download.crashlytics.com/maven' }
maven { url "http://dl.bintray.com/populov/maven" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
minSdkVersion 17
targetSdkVersion 19
}
buildTypes {
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.+'
compile 'com.crashlytics.android:crashlytics:1.+'
}
如果我将minfyEnabled设置为"false",则错误消失了.但我确实希望启用它.
The error is gone if I set the minfyEnabled to "false". But I do want it enabled.
这是项目级别的build.gradle.
Here is the build.gradle in project level.
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
}
}
allprojects {
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
mavenCentral()
jcenter()
}
}
如果我将"2.0.0-alpha3"替换为"1.3.1",该错误也消失了.但是我确实想要"2.0.0",因为我想要即时运行"功能.
The error is also gone if I replace "2.0.0-alpha3" to "1.3.1". But I do want "2.0.0" because I want the "Instant Run" feature.
这是gradle-wrapper.properties.
Here is the gradle-wrapper.properties.
#Mon Dec 21 14:43:00 CST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
有人知道如何解决吗?谢谢.
Does anyone know how to fix it? Thank you.
推荐答案
I had the same issue a few days ago and I found this thread Twitter Developer Forum that points to some incompatibility with versions of gradle/build-tools/crashalics.
我的问题与您的问题略有不同,因为我没有使用alpha-3
,而是使用了1.5
.但是在我的更新中,我也更改为最新的gradle发行版gradle-2.9-all.zip
.
My problem was slightly different from yours as I'm not using alpha-3
I'm using 1.5
. But on my update I also changed to the latest gradle distribution gradle-2.9-all.zip
.
因此,也许(也许)您可以通过更改为最新的gradle版本来对其进行修复.但是,如果它不起作用,那么您真的必须要有耐心,等到build tools V2.0
不再是alpha版本时, OR Crashalitycs团队,修复不兼容的问题.
So probably/maybe you can fix it by changing to the latest gradle version. But If it does not work, you'll really have to be patient and wait until build tools V2.0
is not in alpha anymore OR the Crashalitycs team, fix the incompatibility.
这篇关于如果启用proguard,则无法确定任务':app:crashlyticsStoreDeobsDebug'的依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!