Android:Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
今天开发Android项目时,导入了http有关架包后,程序编译报错如下:
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: G:\Android\LRWebService\app\libs\httpcore-4.4.1.jar
File2: G:\Android\LRWebService\app\libs\httpclient-4.4.1.jar
报错信息截图如下:

观察错误提示后得到错误原因:
因为多个 jar 包里包含了同样的文件(LICENSE.txt),导致打包时因为担心相互覆盖问题而提示出错。
尝试下在 app 下的 build.gradle 中的 android 部分增加一段配置,如下面这段代码所示:
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
}
具体加的位置如图所示位置:

重新编译后,启动成功!
Android:Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.的更多相关文章
- Android:Error:Execution failed for task ':app:clean'. > Unable to delete directory
as clean项目之后有时候会报错. 可以找得到目录删掉,然后重启as,但是下次clean可能又会报类似的错误. 解决方法如下: 进入File-Setting-Build,Execution,De ...
- Android Studio 运行出现 Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
转载请标明出处: http://www.cnblogs.com/why168888/p/5978381.html 本文出自:[Edwin博客园] 我引用compile 'com.squareup.re ...
- 【Android】Error:Execution failed for task ':app:lint'
详细信息如下: Error:Execution failed for task ':app:lint'. > Lint found errors in the project; aborting ...
- Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'
Information:Gradle tasks [:app:assembleDebug]Error:Execution failed for task ':app:transformResource ...
- 终极报错解决方案:Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed with
遇到这个报错的时候,不要慌 Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger fail ...
- Android Studio Error:Execution failed for task ':app:preDebugAndroidTestBuild'.彻底解决的方法以及修改AScompileSDKVersion
Error Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency ...
- [Exception Android 20] - Error:Execution failed for task ':app:processDebugResources'
Error:Execution failed for task ':app:processDebugResources'. > com.android.ide.common.process.Pr ...
- Android Studio:Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching failed, see logs for details
Gradle 编译错误: 14:39:58 Executing tasks: [clean, :app:generateDebugSources, :app:mockableAndroidJar, : ...
- 解决方案:Error:Execution failed for task ':app:compileDebugAidl'. > aidl is missing
也许有朋友最初在用Android Studio创建新工程的时候会碰到这个错误,其实这个问题是由于版本不兼容导致的,解决方法很简单,只需要把编译工具的版本改一下就可以了: 1.选左侧的工程根目录app, ...
随机推荐
- 模块化编程node
众所周知,Node.js 的出现造就了全栈工程师,因为它让 JavaScript 的舞台从浏览器扩大到了服务端 而 Node.js 的强大也得益于它庞大的模块库,所以学习 Node.js 第一步还得从 ...
- 转:JAVA里面的int类型 和Integer类型,有什么不一样
JAVA里面的int类型 和Integer类型,有什么不一样 原文链接:http://blog.csdn.net/wuxinliulei/article/details/11099565 java.l ...
- Neutron控制节点集群
#Neutron控制节点集群 openstack pike 部署 目录汇总 http://www.cnblogs.com/elvi/p/7613861.html #.Neutron控制节点集群 #本实 ...
- Web 动画帧率(FPS)计算
我们知道,动画其实是由一帧一帧的图像构成的.有 Web 动画那么就会存在该动画在播放运行时的帧率.而帧率在不同设备不同情况下又是不一样的. 有的时候,一些复杂或者重要动画,我们需要实时监控它们的帧率, ...
- constructor 属性,判断是否为数组
<!--你可以使用 constructor 属性来查看是对象是否为数组 (包含字符串 "Array"):--><p>constructor属性返回变量或对象 ...
- linux系统下安装配置解压版的MySQL数据库
一.解压文件到当前目录 命令:tar -zxvf mysql....tar.gz 二.移动解压完成的文件夹到目标目录并更名mysql 命令:mv mysql-版本号 /usr/local/mysql ...
- 再学习之Spring(面向切面编程)
一.概念 1.理论 把横切关注点和业务逻辑相分离是面向切面编程所要解决的问题.如果要重用通用功能的话,最常见的面向对象技术是继承(inheritance)或 组成(delegation).但是,如果在 ...
- Prism for WPF初探(构建简单的模块化开发框架)
先简单的介绍一下Prism框架,引用微软官方的解释: Prism provides guidance to help you more easily design and build, flexibl ...
- windows 终端命令详解
打开"运行"对话框(Win+R),输入cmd,打开控制台命令窗口... 也可以通过cmd /c 命令 和 cmd /k 命令的方式来直接运行命令 注:/c表示执行完命令后关闭cmd ...
- C#将dataGridView中显示的数据导出到Excel(大数据量超有用版)
开发中非常多情况下须要将dataGridView控件中显示的数据结果以Excel或者Word的形式导出来,本例就来实现这个功能. 因为从数据库中查找出某些数据列可能不是必需显示出来,在dataGrid ...