我的Android进阶之旅------>解决:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
错误描述
今天在Android Studio项目中加入了jackson的开发包,编译运行时候,引发了如下的错误:
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/NOTICE
File1: D:\Code\XTCKuwoWatch\app\libs\jackson-core-2.4.4.jar
File2: D:\Code\XTCKuwoWatch\app\libs\jackson-databind-2.4.4.jar
错误截图如下所示:
解决办法
看起来是因为多个 jar 包里包含了同样的文件(NOTICE.txt),导致打包时因为担心相互覆盖问题而提示出错。 尝试下在 app 下的 build.gradle 中的 android 部分增加一段配置,如下面这段代码所示:
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
- 没修改前的build.gradle文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.oyp.csdn"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
- 修改后的build.gradle文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
defaultConfig {
applicationId "com.oyp.csdn"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
作者:欧阳鹏 欢迎转载,与人分享是进步的源泉!
转载请保留原文地址:http://blog.csdn.net/ouyang_peng
我的Android进阶之旅------>解决:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.的更多相关文章
- 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:transformResourcesWithMergeJavaResForDebug'.
今天开发Android项目时,导入了http有关架包后,程序编译报错如下: Error:Execution failed for task ':app:transformResourcesWithMe ...
- Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'
Information:Gradle tasks [:app:assembleDebug]Error:Execution failed for task ':app:transformResource ...
- Android 解决Execution failed for task ':app:clean.'报错
说实话,我还真是没见过比Execution failed for task ':app:clean.'更为恶心,更为不要脸的bug啦,代码没啥问题,一下子行让你爽爽,一下子又不鸟你啦,研究了下,终于找 ...
- Android Studio 编译错误 Error:Execution failed for task ':app:buildInfoDebugLoader'.
今天来到打开昨天的项目运行正常,然后改动了一点代码编译报错: Error:Execution failed for task ':app:buildInfoDebugLoader'. > Exc ...
- 我的Android进阶之旅------>解决:Failed to create 'build\outputs\apk\watch-debug-unaligned.apks': 拒绝访问。
1. 错误描述 今天用Android Studio进行项目编译的时候,报错如下所示: FAILURE: Build failed with an exception. * What went wron ...
- 关于android studio 出现Error:Execution failed for task ':app:preDebugAndroidTestBuild'. 的解决办法
Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency 2018年 ...
- Error:Execution failed for task ':app:transformClassesWithDexForDebug'解决记录
转载请标明出处: http://blog.csdn.net/lxk_1993/article/details/50511172 本文出自:[lxk_1993的博客]: 3个错误non-zero e ...
- Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching failed, see logs for details
Android Studio 编译中断.... Error:Execution failed for task ':app:mergeDebugResources'. > Some file c ...
随机推荐
- tomcat打印GC日志
在catinlin.sh的最上面加上 JAVA_OPTS=" -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -Xloggc:/lnmp/tomcat8 ...
- 跟着百度学PHP[17]-PHP扩展CURL的POST传输数据
如果是GET的话就不必那么多设置.但是基本需要用到POST就需要用到以下的几个设置选项. <?php $username = "admin"; $password = &qu ...
- 跟着百度学PHP[14]-PDO的错误处理模式&PDO执行SQL
我们在使用PDO去执行sql语句的时候并不会报错.如下案例所示: <?php try { //$pdo = new pdo("mysql:host=主机;port=端口;dbname= ...
- 恶习为什么难戒?因为你在HALT状态
幸福课 | 恶习为什么难戒?因为你在HALT状态 文 游识猷 饥饿(hungry).生气(angry).孤单(lonely).疲惫(tired)这4种状态,被称为HALT——这个词刚好是英 ...
- CentOS/Linux 网卡设置 IP地址配置永久生效
CentOS/Linux下设置IP地址 1.临时生效设置 1.1修改IP地址 #ifconfig eth0 192.168.100.100 1.2修改网关地址 #route add default g ...
- Chrome调试ECMAScript之断点debug技巧大全!
这篇文章主要介绍了使用Chrome调试JavaScript的断点设置和调试技巧,需要的朋友可以参考下 你是怎么调试 JavaScript 程序的?最原始的方法是用 alert() 在页面上打印内容,稍 ...
- HTTP抓包工具Charles分析
Charles是一款抓包神器,它是Java开发的跨平台的软件,不仅可以在Mac上使用,Linux以及Window下都是可以使用的,当然需要安装JDK,才能运行,他是收费的,需要进行破解. 破解操作:将 ...
- git登陆迁移 SourceTree 不能自动识别
公司切换了迁移了git登陆,具体是什么 我也不是很清楚,结果就是,周一上班 好多小伙伴的git 用不了了,办公室里自然是哀嚎一片, 运维小伙伴给出的解决方案是:改个密码就好啦: 于是照做 结果Sour ...
- poj 1322 Chocolate (概率dp)
///有c种不同颜色的巧克力.一个个的取.当发现有同样的颜色的就吃掉.去了n个后.到最后还剩m个的概率 ///dp[i][j]表示取了i个还剩j个的概率 ///当m+n为奇时,概率为0 # inclu ...
- 解决百度地图Fragment切换黑屏问题
https://blog.csdn.net/rentalphang/article/details/52076330 轻松解决啦!