Duplicate files copied in APK META-INF/LICENSE 编译失败解决方法

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Duplicate files copied in APK META-INF/LICENSE 编译失败解决方法相关的知识,希望对你有一定的参考价值。

# 错误日志
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE File1: /Users/xulun/Downloads/android 2/app/libs/httpclient-4.5.3.jar File2: /Users/xulun/Downloads/android 2/app/libs/httpcore-4.4.6.jar

 

 1 # 解决方法   build.gradle 添加, 看报错而定
 2 android {
 3     packagingOptions {
 4         #exclude META-INF/DEPENDENCIES
 5         #exclude META-INF/NOTICE
 6         exclude META-INF/LICENSE
 7         #exclude META-INF/LICENSE.txt
 8         #exclude META-INF/NOTICE.txt
 9     }
10     // ...
11 }

 

以上是关于Duplicate files copied in APK META-INF/LICENSE 编译失败解决方法的主要内容,如果未能解决你的问题,请参考以下文章

as项目导入异常"duplicate files copied in apk meta-inf/maven/*"

Android Studio 错误 Duplicate files copied in APK META-INF/LICENSE.txt

Android Studio - Gradle 更新升级到2.1.0后,发生Duplicate files copied in APK META-INF

Android学习笔记--遇到Duplicate files copied in APK META-INF/LICENSE.txt

As Error:Duplicate files copied in APK META-INF/LICENSE.txt

解决DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE(或META-INF/DEPENDENCIES)(示例