Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Duplicate files copied in APK META-INF/maven/com.squareup/otto/pom.xml

I'm getting below mentioned error when I'm trying to run my application.

Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForAmazonCheezCoverage'.

com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/com.squareup/otto/pom.xml File1: /Users/afourtest/.gradle/caches/modules-2/files-2.1/com.crashlytics.android/crashlytics/1.1.13/e821eafa1bf489a26bdb71f95078c26785b37a1/crashlytics-1.1.13.jar File2: /Users/afourtest/.gradle/caches/modules-2/files-2.1/com.squareup/otto/1.3.7/69d90fd7fb70e54746e26c10454c220e40a775ce/otto-1.3.7.jar

My app build.gradle is here

like image 479
Amrut Avatar asked Jan 07 '16 07:01

Amrut


1 Answers

Add to build.gradle:

android {
...
    packagingOptions {
         exclude 'META-INF/maven/com.squareup/otto/pom.xml'
}

Also, instead of exclude you could use pickFirst

like image 197
Adam Styrc Avatar answered Oct 23 '22 15:10

Adam Styrc