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.
Execution failed for task ':Example:packageDebugTest'.
> 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
My build.gradle looks like:
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'
}
}
And I don't feel it is a good idea to exclude INDEX.LIST
I guess even if I did that, I'd get duplicates for every file in the jar.
Why is it trying to add EasyMock
twice? How can I stop it from doing this?
NB - Android environments:
Android-Studio
version 0.4.0Android Gradle Plugin
version 0.7.1Gradle
version 1.9