导入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. 【Android开发】交互界面布局详解

    原文:http://android.eoe.cn/topic/summary Android 的系统 UI 为构建您自己的应用提供了基础的框架.主要包括主屏幕 (Home Screen).系统 UI ...

  2. 【转】10个非常有用的网页设计工具 | Goodfav Magazine

    10+ very useful Web Designer Tools Totally free legal computer eBooks download, available in various ...

  3. ISO-OSI的七层协议经典架构

    OSI(Open System interconnection)开放系统互连参考模型 ISO(International Standards Organization)国际标准化组织 第一层:物理层 ...

  4. 【Unity】8.1 Unity内置的UI控件

    分类:Unity.C#.VS2015 创建日期:2016-04-27 一.简介 Unity 5.x内置了-套完整的GUI系统,提供了从布局.控件到皮肤的-整套GUI解决方案,因此可直接利用它做出各种风 ...

  5. 外部程序启动App

    第一种:直接通过包名: Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("com.joyodream. ...

  6. RSA公钥加密,私钥解密的程序示例

    using System;using System.Collections.Generic;using System.Linq;using System.Security.Cryptography;u ...

  7. Fluent UDF【1】:简介

    前面基本完成了动网格专题的发布,不过还是有一些内容并没有更新进去,比如说in-cylinder.接触检测.2.5D网格重构等.不过这些都是小技巧,写起来挺麻烦,以后有时间再通过案例视频的方式讲解好了. ...

  8. lua -- 点击关闭窗口中的子界面

    function UIBagController:initBoxView( ) self.panelBox = tolua.cast(UIHelper:seekWidgetByName(self.ow ...

  9. 【Redis】Redis的基本安装及使用、Jedis的基本使用、spring-data-redis的集成、主从模式、哨兵模式

    在Linux上安装Redis Redis的安装很简单.基本上是下载.解压.运行安装脚本.我用的Redis版本是3.2.1. [nicchagil@localhost app]$ wget -q htt ...

  10. 根据ip查询经纬度的接口

    http://ip-api.com/json/ 直接访问,结果如下 // 20180804140751 // http://ip-api.com/json/ { "as": &qu ...