Android Studio 第三方jar包报错(Error: duplicate files during packaging of APK)

原创 2015年11月18日 16:09:20
Error:duplicate files during packaging of APK I:\work\android\androidstudio\workplace\GuangXiRefuelAPP\app\build\outputs\apk\app-debug-unaligned.apk
    Path in archive: META-INF/LICENSE.txt
    Origin 1: I:\work\android\androidstudio\workplace\********\app\libs\fastjson-1.2.5.jar
    Origin 2: I:\work\android\androidstudio\workplace\********\app\libs\httpmime-4.1.2.jar
You can ignore those files in your build.gradle:
    android {
      packagingOptions {
        exclude 'META-INF/LICENSE.txt'
      }
    }
Error:Execution failed for task ':app:packageDebug'.
> Duplicate files copied in APK META-INF/LICENSE.txt
    File 1: I:\work\android\androidstudio\workplace\********\app\libs\fastjson-1.2.5.jar

    File 2: I:\work\android\androidstudio\workplace\********\app\libs\httpmime-4.1.2.jar



解决方法:

      在app文件下build.gradle中的android节点下加入

     

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




相关文章推荐

Android Studio中怎么引用AAR包 以及 引用时出现的问题 (Error:duplicate files during packaging of APK.......)

在AS中引用aar包时出现 "Error:duplicate files during packaging of APK.......", 如何解决 ??...

Android studio编译错误 duplicate files during packaging of APK...error

Information:Gradle tasks [:app:assembleDebug] :app:preBuild :app:compileDebugNdk UP-TO-DATE :app:pre...

导入京东open-api-sdk引发的“duplicate files during packaging of APK”错误

解决京东SDK--open-api-sdk-2.0.jar的导入编译出错,同时解决了另一个引发的问题,“duplicate files during packaging of APK”错误,仅供大家参...

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

转自:http://blog.csdn.net/ylbf_dev/article/details/50364525 Duplicate files copied in APK META-IN...

Error occurred during initialization of VM解决方法(Android Studio2.2)

Gradle sync failed: Unable to start the daemon process.

android项目编译报错:error occurred during the build

在使用svn从服务器down项目到eclipse的时候,一打开eclipse就报错,提示building workspace error,然后在网上查找了各种方法:汇总一下:1, S...

解决android应用引用第三方jar包混淆打包报错

1、project.properties文件中 取消这行注释 #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:progu...

Audroid-studio2.2安装1%与windows不兼容和Error occurred during initialization of VM 的问题

问题一: Error:CreateProcess error=216,该版本的1%与您运行的Windows版本不兼容。请查看计算机的系统信息,了解是否需要x86或x64版本的程序,然后联系软件发布者 ...

Android Duplicate files copied in APK

今天调试 Android 应用遇到这么个问题: Duplicate files copied in APK META-INF/DEPENDENCIES File 1: httpmime-4.3.2.j...

idea报错:[2016-08-31 09:20:10,763] Artifact xxx:war exploded: Error during artifact deployment.

[2016-08-31 09:20:10,763] Artifact newClassProject1:war exploded: Error during artifact deployment. ...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Android Studio 第三方jar包报错(Error: duplicate files during packaging of APK)
举报原因:
原因补充:

(最多只允许输入30个字)