当我在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 文件
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”,则错误会消失。但我确实希望它启用。这是项目级别中的build.gradle。
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”,因为我想使用“即时运行”功能。这是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
有人知道如何修复吗?谢谢。
flutter clean
并重新构建您的应用程序即可。问题出现在之前的构建被取消之前。我不需要恢复任何依赖项。 - Arpit Yadav