导入eclipse项目时报

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/LICENSE
File1: D:\AndroidStudioProjects\android_client\app\libs\wink-json4j-1.4.jar
File2: D:\AndroidStudioProjects\android_client\app\libs\httpclient-4.5.2.jar

解决办法很简单,在对应报错的模块的build.gradle中添加如下配置即可

android {
...
//为了解决部分第三方库重复打包了META-INF的问题
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
}
}

注意红色字体报的什么就加入什么,列出可能会出现的其他错误解决:

android {  

    packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}

解决DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE(或META-INF/DEPENDENCIES)的更多相关文章

  1. 如何解决DuplicateFileException: Duplicate files copied in APK问题

    问题:有重复的文件存在APK里 解决方案:在Module里的build.gradle中设置忽略此重复文件即可.

  2. com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/NOTICE

    在将vivo eclipse sdk 迁移 android studio  时候报错 Error:Execution failed for task ':vivosdk:transformResour ...

  3. com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK assets/com.xx.xx

    完整的Error 信息(关键部分) Error:Execution failed for task ':fanwe_o2o_47_mgxz_dingzhi:transformResourcesWith ...

  4. 错误: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\b842f960942503cf1abb ...

  5. Android Duplicate files copied in APK

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

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

    1 .Duplicate files copied in APK META-INF/LICENSE.txt   android { packagingOptions { exclude 'META-I ...

  7. Android Studio 错误 Duplicate files copied in APK META-INF/LICENSE.txt解决方案

    My logcat: log Execution failed for task ':Prog:packageDebug'. Duplicate files copied in APK META-IN ...

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

    Error:Execution failed for task ':app:packageDebug'. > Duplicate files copied in APK META-INF/LIC ...

  9. android studio(AS) Duplicate files copied in APK META-INF/NOTICE.txt

    File 1: /home/slava/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpmime/4.3.1/f789 ...

随机推荐

  1. Atitit 如何设置与安放知识的trap陷阱  知识聚合 rss url聚合工具 以及与trap的对比

    Atitit 如何设置与安放知识的trap陷阱  知识聚合 rss url聚合工具 以及与trap的对比 1.1. 安放地点 垂直知识网站csdn cnblogs等特定频道栏目,大牛博客 1 1.2. ...

  2. lua -- 在面板中添加多个部件

    function UIBagController:initItemView( ) -- 获取面板 self.panelCenter = tolua.cast(UIHelper:seekWidgetBy ...

  3. Apache Flink Training and sample code

    http://training.data-artisans.com/ https://github.com/dataArtisans/blog-post-code-samples https://gi ...

  4. Flink安装、高可用性

    Flink JobManager HA模式部署(基于Standalone) SCP 命令 SSH免密码登录,搭建Flink standalone集群 https://blog.csdn.net/jie ...

  5. BD

    销售圣经:终极销售资源(销售必读,行业经典) 销售圣经2:销售之神的21.5条销售法则 Heart and Sell: 10 Universal Truths Every Salesperson Ne ...

  6. 《java虚拟机》汇总所有关键要点

    一  .java虚拟机底层结构详解 我们知道,一个JVM实例的行为不光是它自己的事,还涉及到它的子系统.存储区域.数据类型和指令这些部分,它们描述了JVM的一个抽象的内部体系结构,其目的不光规定实现J ...

  7. 【Android】LayoutInflater

    LayoutInflater的作用 LayoutInflater的作用类似于findViewById(). 不同点是: LayoutInflater是用来找res/layout/下的xml布局文件,并 ...

  8. windows开通https服务

    一.申请ssl证书 建议1个免费的ssl证书申请网站,已测试,可用 1.注册https://login.wosign.com/reg.html?rf=buy 2.邮箱验证登录后访问https://bu ...

  9. SqlServer select * into 对应 Oracle语法

    创建新表,并插入旧表值 Sql Server select * into new_emp from emp; Oracle create table new_emp as select * from ...

  10. 【神经网络】LSTM 网络

      Long Short Term 网络—— 一般就叫做 LSTM ——是一种 RNN 特殊的类型,可以学习长期依赖信息.LSTM 由Hochreiter & Schmidhuber (199 ...