Error:Execution failed for task ':app:mergeDebugResources'

今天在AndroidStudio中导入了一个项目,运行显示下列异常信息

Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2311Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement810Library UP-TO-DATE
:app:prepareComQozixTileview214Library UP-TO-DATE
:app:prepareComTimehopStickyheadersrecyclerviewLibrary043Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources
AAPT err(Facade for 977769301): libpng error: Read Error
Error:Execution failed for task ':app:mergeDebugResources'.
> Crunching Cruncher app_icon.png failed, see logs
Information:BUILD FAILED
Information:Total time: 1.31 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

这里备注一下解决方案:

查看报错日志

Error:Execution failed for task ‘:app:mergeDebugResources’.
Crunching Cruncher app_icon.png failed, see logs

首先可以定位到资源有问题.

为什么有这个问题呢?

将app_icon复制到项目外边,有看图软件打开,显示图片有损害

这里写图片描述

美工给的png的图,但它并不是真实的png格式,所以导致了运行异常。

不会检查这么仔细,常常引起这个错误的有

- 1 以数字开头命名的
- 2 图片格式有问题
- 3 伪.9 图片
- 4 直接将jpg格式的图片更改后缀名,更改为png格式。

发生问题时候首先检查异常发生图片的格式是否正确

这里写图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值