Android Studio编译项目 9 patch图片报错

报错信息如下:
这里写图片描述

so,打开gradle console控制台,发现错误详细如下:

Executing tasks: [:sortListViewDemo:assembleDebug]

Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:sortListViewDemo:preBuild UP-TO-DATE
:sortListViewDemo:preDebugBuild UP-TO-DATE
:sortListViewDemo:checkDebugManifest
:sortListViewDemo:prepareDebugDependencies
:sortListViewDemo:compileDebugAidl UP-TO-DATE
:sortListViewDemo:compileDebugRenderscript UP-TO-DATE
:sortListViewDemo:generateDebugBuildConfig UP-TO-DATE
:sortListViewDemo:generateDebugResValues UP-TO-DATE
:sortListViewDemo:generateDebugResources UP-TO-DATE
:sortListViewDemo:mergeDebugResources
Error: java.lang.RuntimeException: Some file crunching failed, see logs for details
:sortListViewDemo:mergeDebugResources FAILED

**AAPT err(Facade for 972347635): ERROR: 9-patch image D:\GitWorkSpace\MyAndroidStudy\sortListViewDemo\src\main\res\drawable\search_bar_edit_normal.9.png malformed.
AAPT err(Facade for 972347635):        Frame pixels must be either solid or transparent (not intermediate alphas).
AAPT err(Facade for 972347635):        Found at pixel #15 along top edge.
AAPT err(Facade for 1299302347): ERROR: 9-patch image D:\GitWorkSpace\MyAndroidStudy\sortListViewDemo\src\main\res\drawable\search_bar_edit_pressed.9.png malformed.
AAPT err(Facade for 1299302347):        Frame pixels must be either solid or transparent (not intermediate alphas).
AAPT err(Facade for 1299302347):        Found at pixel #15 along top edge.**

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sortListViewDemo:mergeDebugResources'.
> Error: java.lang.RuntimeException: Some file crunching failed, see logs for details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1.339 secs

原因:图片中包含有alpha通道所以在执行app:mergeDebugResources时出现了错误
解决方案:让UI同学重新切一张没有alpha通道的图即可。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值