title: Android Studio and Gradle - build fails
body: <p>I am building a small library project along wit a sample project to illustrate the use. I can't manage to run the sample in Android Studio. I have created the project from scratch. I am experienced with Eclipse but it's my first try at Android Studio &amp; Gradle.</p>
  
  <p>The error given:</p>
  
  <blockquote>
    <p>Gradle: Execution failed for task ':demo:dexDebug'.</p>
    
    <p>Running C:\DevTools\Android\android-studio\sdk\build-tools\android-4.2.2\dx.bat
    failed. See output</p>
  </blockquote>
  
  <p>I have the following folder structure:</p>
  
  <pre><code>- demo
    - build
    - libs
      - android-support-v4.jar
    - src
      - main
        - java
        - res
    - build.gradle
  - library
    - build
    - libs
      - android-support-v4.jar
    - src
      - main
        - java
        - res
    - build.gradle
  - build.gradle
  - settings.gradle
  </code></pre>
  
  <p>Build.gradle at project root:</p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  </code></pre>
  
  <p>Settings.gradle at project root:</p>
  
  <pre><code>include ':library', ':demo'
  </code></pre>
  
  <p>Build.gradle for the library module:</p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:0.4'
      }
  }
  apply plugin: 'android-library'
  
  dependencies {
      compile files('libs/android-support-v4.jar')
  }
  
  android {
      compileSdkVersion 17
      buildToolsVersion "17.0.0"
  
      defaultConfig {
          minSdkVersion 7
          targetSdkVersion 16
      }
  }
  </code></pre>
  
  <p>Build.gradle for the sample module:</p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral() 
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:0.4'
      }
  }
  apply plugin: 'android'
  
  dependencies {
      compile project(':library')
      compile files('libs/android-support-v4.jar')
  }
  
  android {
      compileSdkVersion 17
      buildToolsVersion "17.0.0"
  
      defaultConfig {
          minSdkVersion 7
          targetSdkVersion 16
      }
  }
  </code></pre>