我最近决定从 Eclipse 切换到 Android Studio。我导入了一个我正在处理的项目,现在当我尝试运行该项目时出现此错误。
Gradle: Execution failed for task ':project:dexDebug'.
> Could not call IncrementalTask.taskAction() on task ':project:dexDebug'
我已经在这个网站上巡游了 2 天,尝试了不同的建议,但无济于事。我确实运行了 gradlew compileDebug --stacktrace 这就是我得到的:
C:\Users\adam\AndroidStudioProjects\projectProject>gradlew compileDebug --stacktrace
Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
:project:preBuild UP-TO-DATE
:project:preDebugBuild UP-TO-DATE
:project:preReleaseBuild UP-TO-DATE
:project:prepareComAndroidSupportAppcompatV71800Library UP-TO-DATE
:project:prepareComGoogleAndroidGmsPlayServices3225Library UP-TO-DATE
:project:prepareDebugDependencies
:project:compileDebugAidl UP-TO-DATE
:project:compileDebugRenderscript UP-TO-DATE
:project:generateDebugBuildConfig UP-TO-DATE
:project:mergeDebugAssets UP-TO-DATE
:project:mergeDebugResources UP-TO-DATE
:project:processDebugManifest UP-TO-DATE
:project:processDebugResources UP-TO-DATE
:project:generateDebugSources UP-TO-DATE
:project:compileDebug UP-TO-DATE
BUILD SUCCESSFUL
Total time: 10.459 secs
但是,当我尝试实际运行该项目时,我仍然遇到该错误。这是我的 build.gradle(我的项目中确实有一个“libs”文件夹,其中包含 google maps/places 应用程序的所有 jar):
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 18
buildToolsVersion "18.1.1"
defaultConfig {
minSdkVersion 8
targetSdkVersion 18
}
}
dependencies {
compile fileTree(dir: 'libs')
compile 'com.google.android.gms:play-services:3.2.25'
compile 'com.android.support:support-v4:18.0.0'
compile 'com.android.support:appcompat-v7:+'
}
和我的 settings.gradle:
include ':project', ':project:libs:android-support-v4', ':project:libs:google-api-client-1.10.3-beta',
':project:libs:google-api-client-android2-1.10.3-beta', ':project:libs:google-http-client-1.10.3-beta',
':project:libs:google-http-client-android2-1.10.3-beta', ':project:libs:google-oauth-client-1.10.1-beta',
':project:libs:gson-2.1', ':project:libs:guava-11.0.1', ':project:libs:jackson-core-asl-1.9.4',
':project:libs:jsr305-1.3.9', ':project:libs:protobuf-java-2.2.0', ':project:libs:GoogleAdMobAdsSdk-6.4.1'
正如我所说,我已经尝试了几乎所有我在这里读到的关于这个错误的东西,但没有运气。任何帮助将不胜感激。