当我尝试运行我的应用程序时遇到下面提到的错误。
错误:任务“: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
我的应用程序 build.gradle 是 here
最佳答案
添加到build.gradle:
android {
...
packagingOptions {
exclude 'META-INF/maven/com.squareup/otto/pom.xml'
}
此外,您可以使用 pickFirst
而不是 exclude关于android - APK META-INF/maven/com.squareup/otto/pom.xml 中复制的重复文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34649615/