在许多图书馆中复制APK META-INF中复制的文件? [英] Duplicate files copied in APK META-INF on many libraries?

查看:180
本文介绍了在许多图书馆中复制APK META-INF中复制的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



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


com.android.build.api.transform.TransformException:com.android.builder.packaging.DuplicateFileException:在APK META-INF / services / com.sun中复制的重复文件。 jersey.spi.inject.InjectableProvider
File1:/home/xxxxxxx/.gradle/caches/modules-2/files- 2.1 / com.sun.jersey / jersey-core / 1.19.1 / 4282d106f2acd5051bd9bc2935ed9a2920c9385 / jersey-core -1.19.1.jar
File2:/home/xxxxxxx/.gradle/caches/modules-2/files-2.1/com.sun.jersey.contribs/jersey- multipart / 1.19.1 / b8700842c5005dab05831319bc8f072d51e26396 / jersey- multipart-1.19.1.jar


我找不到应该有重复的依赖项。



当我在build.gradle中排除文件时,可以使用,但是我刚刚收到导致重复错误的其他文件...感到奇怪,我shou ld写这个长排除列表。

解决方案

您可以在 build.gradle 文件中排除此文件:

  packagingOptions {
exclude'META-INF / **'
exclude'META-INF / **'
}

看看这个质询


I get this error when trying to build APK,

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

com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/services/com.sun.jersey.spi.inject.InjectableProvider File1: /home/xxxxxxx/.gradle/caches/modules-2/files- 2.1/com.sun.jersey/jersey-core/1.19.1/4282d106f2acd5051bd9bc2935ed9a2920c9385/jersey-core-1.19.1.jar File2: /home/xxxxxxx/.gradle/caches/modules-2/files-2.1/com.sun.jersey.contribs/jersey- multipart/1.19.1/b8700842c5005dab05831319bc8f072d51e26396/jersey-multipart-1.19.1.jar

I can't find that I should have duplicates of dependencies.

Works when I exclude the file in build.gradle, but then I just get som other file that causing duplicate error.. feel strange that I should write this long exclude list.

解决方案

You can exclude this files on your build.gradle file:

packagingOptions {
    exclude 'META-INF/**'
    exclude 'META-INF/**'
}

Take a look at this question.

这篇关于在许多图书馆中复制APK META-INF中复制的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆