Android Error:Execution failed for task ':app:mergeDebugResources'. > Crunching Cruncher bg_btn.9.png
使用Android Studio来进行图片背景设置,编译时发生了一个mergeDebugResources异常。

异常原因
- 这个异常的意思是对资源合并发生错误,那就是我使用的图片资源有问题,我使用的图片是能在android环境自适应展示的.9.png格式,在Eclipse上使用是能通过编译的,但是为什么在android studio上就不能呢?
- 原来,android studio中的资源文件命名是不能带有数字的,因为会与R类的资源ID起冲突,所以编译就发生了错误。
解决方式
- 方式一:只需重新命名图片即可,在Make Project一下编译就能通过了。
方式二:我们可以用代码去除掉android studio对png格式文件的检测,这样系统就不会检测png格式的资源文件了。
找到app->build.gradle文件并打开,在buildToolsVersion属性下添加如下代码
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false

完整的build.gradle文件如下,修改完成再Make Project一下就不会报错了。

Android Error:Execution failed for task ':app:mergeDebugResources'. > Crunching Cruncher bg_btn.9.png的更多相关文章
- Error:Execution failed for task ':app:mergeDebugResources'. > Crunching Cruncher ******.9.png
有时候在Android Studio导入Eclipse项目时,会出现Error:Execution failed for task ':app:mergeDebugResources'. > C ...
- 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 ...
- Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching failed, see logs f
今天调试安卓程序遇到的问题Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching fa ...
- Android Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency
错误内容: Error:Execution failed for task ':app:preDebugAndroidTestBuild'.> Conflict with dependency ...
- 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, : ...
- Android Error:Execution failed for task ':app:compileDebugJavaWithJavac' 解决方案
今天使用 Android Studio 构建项目的时候出现了这个错误 compileDebugJavaWithJavac 通过搜索发现造成该问题的原因有很多需要结合具体的项目进行排查 通过 Andro ...
- Error:Execution failed for task ':app:mergeDebugResources'. > Error: Some file crunching failed, see logs for details
android studio中的资源文件命名是不能带有数字的,因为会与R类的资源ID起冲突,所以编译就发生了错误.
- Android Studio 运行出现 Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
转载请标明出处: http://www.cnblogs.com/why168888/p/5978381.html 本文出自:[Edwin博客园] 我引用compile 'com.squareup.re ...
- Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException
异常Log: Error:Execution failed for task ‘:app:dexDebug’. > com.android.ide.common.process.ProcessE ...
随机推荐
- hdu A计划
这道题是一道bfs的题目,因为题目中给的数据很小,所以可以采用优先队列的方式来简化处理.这道题在搜索的过程中要注意map1的不同层次的转换,即对'#'的理解.之前wa了两次是因为我考虑了如果上下两层对 ...
- Html - 对话箭头
对话箭头 <!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="U ...
- 通过Sysprep封装系统
<?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schema ...
- HTTP 笔记与总结(9)分块传输、持久链接 与 反向 ajax(comet / server push / 服务器推技术)
反向 ajax 又叫 comet / server push / 服务器推技术 应用范围:网页聊天服务器,例如新浪微博在线聊天.google mail 网页聊天 原理:一般而言,HTTP 协议的特点是 ...
- centos7 安装mysql5.7及配置
一.Mysql 各个版本区别:1.MySQL Community Server 社区版本,开源免费,但不提供官方技术支持.2.MySQL Enterprise Edition 企业版本,需付费,可以试 ...
- php中ajax跨域请求---小记
php中ajax跨域请求---小记 前端时间,遇到的一个问题,情况大约是这样: 原来的写法: 前端js文件中: $.ajax({ type:'get', url:'http://wan.xxx.c ...
- 通过SocketLog快速分析OneThink程序
通过SocketLog快速分析OneThink程序 http://www.thinkphp.cn/topic/10846.html 浏览:2332 发布日期:2014/02/08 分类:技术分享 ...
- 前端框架Bootstrap的Modal使用Ajax数据源,如何避免数据被缓存
1.绑定事件,在关闭的时候,直接将数据清除: $("#model").on("hidden.bs.model",function(e){$(this).remo ...
- 2014总结&2015计划
2014总结&2015计划 今天是2015/1/1,新的一年终于到来了,昨天老板要求提交2014的工作总结和2015的工作计划,正好提醒我,要总结和计划了. 先回顾2014年初的计划: 新年计 ...
- kudu
Kudu White Paper http://www.cloudera.com/documentation/betas/kudu/0-5-0/topics/kudu_resources.html h ...