Error:duplicate files during packaging of APK app/build/output/apk

在gradle配置文件加入:

android {
    packagingOptions {
        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‘
    }
}

在运行一次APP即可以成功编译。

时间: 2024-08-29 12:38:06

Error:duplicate files during packaging of APK app/build/output/apk的相关文章

Error:duplicate files during packaging of APK app\

Error:duplicate files during packaging of APK app\build\outputs\apk\app-debug-unali 这个错误的解决方法是:在app的build.gradle文件中增加以下内容:     packagingOptions {         exclude 'META-INF/DEPENDENCIES.txt'         exclude 'META-INF/LICENSE.txt'         exclude 'META

Android问题集锦之四十八:Error:duplicate files during packaging of APK

端午小长假最后一天,大雨.只好在家里鼓捣自己喜欢的代码了. 在将dom4j.jar也加入fastjson测试程序中,编译出错,如下: Error:duplicate files during packaging of APK /home/linc/workspace/lab/FastjsonTestor/app/build/outputs/apk/app-debug-unaligned.apk Path in archive: META-INF/LICENSE.txt Origin 1: /ho

duplicate files during packaging of APK

问题描述 在使用Android studio引入第三方jar包,打包时出错 Error:duplicate files during packaging of APK F:\Travel\app\build\outputs\apk\app-debug-unaligned.apk Path in archive: META-INF/NOTICE.txt Origin 1: F:\Travel\app\libs\commons-codec-1.6.jar Origin 2: F:\Travel\ap

错误:com.android.builder.packaging.DuplicateFileException: Duplicate files copied

File2: C:\Users\guoxw\.gradle\caches\modules-2\files-2.1\org.jsoup\jsoup\1.10.3\b842f960942503cf1abbcc8c173a7f2c19d43726\jsoup-1.10.3.jarError:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. > com.android.build.api.transf

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

在修改老的项目中遇到的此问题,导入jar包的时候报 Error:Execution failed for task ':ADApplication:transformResourcesWithMergeJavaResForDebug'.> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied i

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

Error:Execution failed for task ':app:packageDebug'. > Duplicate files copied in APK META-INF/LICENSE.txt File 1: /Users/weichunsheng/.gradle/caches/modules-2/files-2.1/commons-cli/commons-cli/1.2/2bf96b7aa8b611c177d329452af1dc933e14501c/commons-cli-

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

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

今天升级了Android Studio到2.1正式版,发现其建议更新Gradle版本,于是把Gradle更新到2.1.0,但是更新后项目无法跑,报错:Duplicate files copied in APK META-INF. 之前项目也有遇到同样的问题,只需要在app项目中(我的项目有几个子module)添加以下代码就可以了: packagingOptions { exclude 'META-INF/LICENSE.txt' exclude 'META-INF/LICENSE' exclud

Android Duplicate files copied in APK

今天调试 Android 应用遇到这么个问题: Duplicate files copied in APK META-INF/DEPENDENCIES File 1: httpmime-4.3.2.jar File 2: httpmime-4.3.2.jar 貌似说两个包里面的文件重复了还是怎么的,谷歌了一番之后据说应该是 android studio 自身的bug 解决办法: 打开项目下面的 build.gradle 文件,在 android 代码块中添加下面代码 android { pack