我收到此错误:
Gradle: Execution failed for task ':Foo:dexDebug'.
从 2 天开始!我尝试了很多解决方案......但没有任何工作正常!真的 !需要帮忙 !我与安卓工作室一起工作。(智能思想)
对于这以下三个目录
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']
}
}
}