使用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. 命令行安装KVM

    查看libvirtd的状态: [root@super67 ~]# /etc/init.d/libvirtd status libvirtd (pid  2503) is running... 安装vn ...

  2. <html:option获取文本值

    <p class="w120">变更后IP:</p> <div class="comBobox w200 f_l"> < ...

  3. 7. Add a networking service

    Controller Node: 1. sudo vi /etc/nova/nova.conf [DEFAULT] ... network_api_class = nova.network.api.A ...

  4. yii uploadfile 错误提示: fileinfo php extension is not installed

    rule规则里面增加 'checkExtensionByMimeType'=>false,

  5. CodeForces 577B 模和vecto

    上一年的最后一次训练赛被卡了AK... 一开始天真的认为每个数字都进行取模 然后认为它是一个vol为取模后的数 val为0的01背包 去计算dp[m]能否被装满 只想到了其中的一点..简直天真 后来看 ...

  6. Web 在线文件管理器学习笔记与总结(6)jQuery UI 预览图片

    ① 查看文件内容,如果文件是图片类型,点击直接查看图片: ② 如果不是图片类型,显示文件中的内容: ③ 使用 jQuery UI 中的 Dialog 显示图片 a.引入: <script src ...

  7. 推荐25款php中非常有用的类库

    推荐25款php中非常有用的类库 投稿:hebedich 字体:[增加 减小] 类型:转载 时间:2014-09-29   作为一个PHP开发者,现在是一个令人激动的时刻.每天有许许多多有用的库分发出 ...

  8. 用 BigDump 工具导入超大 MySQL 数据库备份文件

    用 BigDump 工具导入超大 MySQL 数据库备份文件  创建于 2010-07-01, 周四 00:00  作者 白建鹏 在<Joomla! 1.5 网站防黑9条戒律>这篇文章中, ...

  9. 【IOS笔记】View Controller Basics

    View Controller Basics   视图控制器基础 Apps running on iOS–based devices have a limited amount of screen s ...

  10. Socket简介

    本文全部摘抄http://c.biancheng.net/cpp/html/3029.html 大多数项目是在Linux下开发服务器端,而在Windows下开发客户端,需要经常在两大平台之间进行切换, ...