title: Android Studio - Gradle: Execution failed for task ':Foo:dexDebug' - but why?
body: <p>I receive this error :</p>
  
  <pre><code>Gradle: Execution failed for task ':Foo:dexDebug'.
  </code></pre>
  
  <p>And since 2day ! I have try a lot of solution... But nothing work fine ! Really ! Need Help !
  I work with android Studio. (IntelliJ IDEA)</p>
  
  <p>For this following three directory</p>
  
  <pre><code>   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
  </code></pre>
  
  <p>I have for my settings.gradle</p>
  
  <pre><code>include ':libraries:facebook', :libraries:foosdk', ':foo'
  </code></pre>
  
  <p>For the files "build.gradle" :</p>
  
  <p><strong>For libraries/facebook/build.gradle</strong></p>
  
  <pre><code>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']
          }
      }
  }
  </code></pre>
  
  <p><strong>For libraries/foosdk/build.gradle</strong></p>
  
  <pre><code>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']
          }
      }
  }
  </code></pre>
  
  <p><strong>For Foo/build.gradle</strong></p>
  
  <pre><code>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']
          }
      }
  }
  </code></pre>