Could not determine the dependencies of task ':app:crashlyticsStoreDeobsDebug' if I enable the proguard

匿名 (未验证) 提交于 2019-12-03 02:50:02

问题:

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 

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.+' } 

The error is gone if I set the minfyEnabled to "false". But I do want it enabled.

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

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.

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.

回答1:

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.

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.

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.



回答2:

In place of 1.+ use the latest version of crashlytics -

 dependencies {         classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'     } 

you should use this way -

dependencies {             classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:2.6.8'         } 

your problem will be resolved for sure. Happy coding !!



回答3:

I was encountering the same issue. In my App build.gradle I had

apply plugin: 'com.android.application' apply plugin: 'dexguard' apply plugin: 'io.fabric' 

I just switched Dexguard and Fabric, then it worked!

apply plugin: 'com.android.application' apply plugin: 'io.fabric' apply plugin: 'dexguard' 


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!