title: Gradle and Android Studio Duplicate File Copied from same jar
body: <p>When trying to include EasyMock in my Android project, I get the following error when running my tests.  Which is trying to package up the same jar twice.</p>
  
  <pre><code>Execution failed for task ':Example:packageDebugTest'.
  &gt; Duplicate files copied in APK META-INF/INDEX.LIST
      File 1: /home/me/.gradle/caches/modules-2/files-2.1/org.easymock/easymock/3.2/c82f7fa3ef377d8954b1db25123944b5af2ba4/easymock-3.2.jar
      File 2: /home/me/.gradle/caches/modules-2/files-2.1/org.easymock/easymock/3.2/c82f7fa3ef377d8954b1db25123944b5af2ba4/easymock-3.2.jar
  </code></pre>
  
  <p>My build.gradle looks like:</p>
  
  <pre><code>android {
  ...
  packagingOptions {
      exclude 'META-INF/LICENSE.txt'
      exclude 'META-INF/LICENSE'
      exclude 'META-INF/NOTICE'
      exclude 'META-INF/license.txt'
  }
  ...
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: '*.jar')
      instrumentTestCompile 'junit:junit:3.8.2+'
      instrumentTestCompile('org.easymock:easymock:3.2'){
          exclude group: 'junit', module: 'junit'
      }
  }
  </code></pre>
  
  <p>And I don't feel it is a good idea to exclude <code>INDEX.LIST</code>  I guess even if I did that, I'd get duplicates for every file in the jar.</p>
  
  <p>Why is it trying to add <code>EasyMock</code> twice? How can I stop it from doing this?</p>
  
  <p>NB - Android environments:</p>
  
  <ul>
  <li><p><code>Android-Studio</code> version 0.4.0</p></li>
  <li><p><code>Android Gradle Plugin</code> version 0.7.1</p></li>
  <li><p><code>Gradle</code> version 1.9</p></li>
  </ul>