使用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的更多相关文章

  1. Error:Execution failed for task ':app:mergeDebugResources'. > Crunching Cruncher ******.9.png

    有时候在Android Studio导入Eclipse项目时,会出现Error:Execution failed for task ':app:mergeDebugResources'. > C ...

  2. 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 ...

  3. 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 ...

  4. Android Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency

    错误内容: Error:Execution failed for task ':app:preDebugAndroidTestBuild'.> Conflict with dependency ...

  5. 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, : ...

  6. Android Error:Execution failed for task ':app:compileDebugJavaWithJavac' 解决方案

    今天使用 Android Studio 构建项目的时候出现了这个错误 compileDebugJavaWithJavac 通过搜索发现造成该问题的原因有很多需要结合具体的项目进行排查 通过 Andro ...

  7. Error:Execution failed for task ':app:mergeDebugResources'. > Error: Some file crunching failed, see logs for details

    android studio中的资源文件命名是不能带有数字的,因为会与R类的资源ID起冲突,所以编译就发生了错误.

  8. Android Studio 运行出现 Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.

    转载请标明出处: http://www.cnblogs.com/why168888/p/5978381.html 本文出自:[Edwin博客园] 我引用compile 'com.squareup.re ...

  9. 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 ...

随机推荐

  1. php pdo分页

    <table width="95%" border="1" cellspacing="0" cellpadding="0&q ...

  2. Js组件的一些写法【转】

    首先看下Prototype里的写法: var Class = { create: function() { return function() { this.init.apply(this, argu ...

  3. ibatis动态sql配置启动时提示:The content of elements must consist of well-formed character data...

    ibatis动态sql配置启动时提示:The content of elements must consist of well-formed character data... 2012-07-18 ...

  4. 给Android程序员的六个建议

    给Android程序员的六个建议 分类: 安卓相关2015-07-14 23:58 177人阅读 评论(0) 收藏 举报 android程序员 如果你一年前写的代码 , 在现在看来你还感觉写的很不错 ...

  5. jQuery 利用 $.getJson() 实现跨域

    数据量不大时,跨域的不二之选,而且操作简单,易上手. a.com/test.html //这里我假定有一些数据: var formData = form.serialize(); //这里的jsonc ...

  6. 【转载】C编译过程概述

    gcc:http://www.cnblogs.com/ggjucheng/archive/2011/12/14/2287738.html#_Toc311642844 gdb:http://www.cn ...

  7. Linux环境PHP7.0安装

    原文地址:http://blog.csdn.net/21aspnet/article/details/47708763 PHP7和HHVM比较 PHP7的在真实场景的性能确实已经和HHVM相当, 在一 ...

  8. IN()

    High Performance My SQL, Third Edition Consider the followingWHERE clause: WHERE eye_color IN('brown ...

  9. sql_action

    CREATE TABLE w SELECT * FROM existing_table 2 日期x idm valuexm 日期x idn  valuexn 日期y idm  valueym 日期y ...

  10. win2003 老的ASP程序报错 Microsoft OLE DB Provider for Orac(0x80004005)

    ASP连接ORACLE报错,记得环境刚配置完成的时候一切正常,今天莫名其妙的报错了 报错位置78行: 这是一个很老的系统,代码没人去东,只是从老的机器迁移到新的服务器中,想想应该是环境的问题 网上搜索 ...