gpt4 book ai didi

java - 安卓工作室-Gradle : Execution failed for task ':Foo:dexDebug' - but why?

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:27:07 25 4
gpt4 key购买 nike

我收到这个错误:

Gradle: Execution failed for task ':Foo:dexDebug'.

从 2 天开始!我已经尝试了很多解决方案......但没有任何效果!真的 !需要帮忙 !我在 android Studio 工作。 (IntelliJ IDEA)

对于下面这三个目录

   FooProject [RootProject]
|-gradle
|-libraries
|-facebook [library1]
|-libs
|-android-support-v4.jar
|-res
|-*.(drawable...)
|-src
|-*.java
|-build.gradle
|-AnroidManifest.xml
|-facebook.iml
|-foosdk [library2]
|-res
|-*.(drawable...)
|-src
|-*.java
|-libs
|-YouTubeAndroidPlayerApi.jar
|-build.gradle
|-AnroidManifest.xml
|-foosdk.iml
|-Foo [project for execution]
|-libs
|-commons-io-1.3.2.jar
|-commons-lang3-3.1.jar
|-jackson-core-asl-1.9.11.jar
|-jackson-databind-2.1.4.jar
|-jackson-mapper-asl-1.9.11.jar
|-robospice-1.4.1-SNAPSHOT.jar
|-robospice-cache-1.4.1-SNAPSHOT.jar
|-robospice-spring-android-1.4.1-SNAPSHOT.jar
|-spring-android-core-1.0.1.RELEASE.jar
|-spring-android-rest-template-1.0.1.RELEASE.jar
|-YouTubeAndroidPlayerApi.jar
|-src
|-main
|-java
|-*.java
|-res
|-*.(drawable...)
|-build.gradle
|-AnroidManifest.xml
|-Foo.iml
|-gradlew
|-gradlew.bat
|-local.properties
|-settings.gradle
|-RootProject.iml

我有我的 settings.gradle

include ':libraries:facebook', :libraries:foosdk', ':foo'

对于文件“build.gradle”:

对于图书馆/facebook/build.gradle

buildscript {
repositories {
maven { url 'http://repo1.maven.org/maven2' }
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}

apply plugin: 'android-library'

dependencies {
compile 'com.android.support:support-v4:13.0.0'
}

android {
compileSdkVersion 17
buildToolsVersion "17.0.0"

defaultConfig {
minSdkVersion 9
targetSdkVersion 16
}

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}

对于库/foosdk/build.gradle

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}

apply plugin: 'android-library'

dependencies {
compile 'com.android.support:support-v4:13.0.0'
compile fileTree(dir: 'libs', include: '*.jar')
}

android {
compileSdkVersion 17
buildToolsVersion "17.0.0"

defaultConfig {
minSdkVersion 9
targetSdkVersion 16
}

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}

对于 Foo/build.gradle

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}

apply plugin: 'android'

repositories {
mavenCentral()
}

dependencies {
compile 'com.android.support:support-v4:13.0.0'

compile project(':libraries:foosdk')
compile project(':libraries:facebook')
compile fileTree(dir: 'libs', include: '*.jar')
}



android {
compileSdkVersion 17
buildToolsVersion "17.0.0"

defaultConfig {
minSdkVersion 9
targetSdkVersion 16
}

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src/main/java']
resources.srcDirs = ['src']
res.srcDirs = ['src/main/res']
}
}
}

最佳答案

您的 Foo 项目在/Foo 或/foo 文件夹中(注意大写)?您可能需要将 include 'foo' 更正为 'Foo'?

如果这不起作用,请粘贴 Gradle 构建的信息或调试输出。如果您正在运行 AndroidStudio 并且没有任何输出,请转到项目的根目录并运行 gradlew.bat assembleDebug --info(在 Wins 上)或 ./gradlew assembleDebug - -info(在 Linux/Mac 上)或 --debug 并将输出粘贴到此处,以便我们可以准确地查看问题所在。

关于java - 安卓工作室-Gradle : Execution failed for task ':Foo:dexDebug' - but why?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18516695/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com