重复文件异常

时间:2017-09-06 07:13:40

标签: android

添加了depandency后出现此错误   编译'com.longtailvideo.jwplayer:jwplayer-ima:+'

错误:任务':app:transformResourcesWithMergeJavaResForDebug'的执行失败。

  

com.android.build.api.transform.TransformException:com.android.builder.packaging.DuplicateFileException:在APK META-INF / nanohttpd / mimetypes.properties中复制的重复文件           File1:C:\ Users \ gauravkumar.singh.gradle \ _caches \ modules-2 \ files-2.1 \ com.google.ads.interactivemedia.v3 \ interactivemedia \ 3.5.2 \ 21246e1a6815dc499443d46f9f5dbe954fd2b746 \ interactivemedia-3.5.2.jar           File2:C:\ Users \ gauravkumar.singh.android \ build-cache \ fe94083f69d19de3fbe36d97989e4bfe87efb104 \ output \ jars \ classes.jar

2 个答案:

答案 0 :(得分:0)

尝试这在我的情况下有效

在build.gradle文件解决问题

上添加以下文字
packagingOptions {
    exclude  'jsr305_annotations/Jsr305_annotations.gwt.xml'
    exclude  'build-data.properties'
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/LGPL2.1'
 }

答案 1 :(得分:0)

由于错误消息表明您没有排除存在于多个依赖项中的META-INF / LICENSE文件

packagingOptions {
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE'
     exclude 'META-INF/notice'
     exclude 'META-INF/notice.txt'
     exclude 'META-INF/license'
     exclude 'META-INF/license.txt'
}