9片图像prevent构建项目机器人工作室 [英] 9 patch image prevent build project android studio
问题描述
我移动到摇篮建设。但我有这个错误了很多的9片图像。
I am moving to Gradle build . but i have this error for a lot of 9-patch images .
请注意可绘制的是 http://android-holo-colors.com
自动生成
但他们都老了。
Note the drawable is auto generated by http://android-holo-colors.com
but they are old.
我使用的Android工作室 0.5.1
我的构建工具的版本是 19.0.3
这是错误
I am using android studio 0.5.1
and my build tool version is 19.0.3
this is the error
Error:Execution failed for task ':app:mergeDebugResources'.
> Error: Failed to run command:
/Applications/Android Studio.app/sdk/build-tools/19.0.3/aapt s -i /Users/Ed/Desktop/TestAndroid/app/src/main/res/drawable-mdpi/spinner_default_holo_dark.9.png -o /Users/Ed/Desktop/TestAndroid/app/build/res/all/debug/drawable-mdpi/spinner_default_holo_dark.9.png
Error Code:
42
Output:
ERROR: 9-patch image /Users/Ed/Desktop/TestAndroid/app/src/main/res/drawable-mdpi/spinner_default_holo_dark.9.png malformed.
Frame pixels must be either solid or transparent (not intermediate alphas).
Found at pixel #3 along top edge.
/Users/Ed/Desktop/TestAndroid/app/src/main/res/drawable-hdpi/cab_background_bottom_test.9.png
Error:Ticks in transparent frame must be black or red. - ERROR: 9-patch image /Users/Ed/Desktop/TestAndroid/app/src/main/res/drawable-mdpi/spinner_default_holo_dark.9.png malformed.
任何人都面临同样的问题。
Anyone faced the same problem.
推荐答案
您是否尝试过按照错误日志中的建议吗? 即看看第3(如果将其视为零索引可能是4?)像素沿顶行中的图像编辑器:
Have you tried following the suggestions in the error log? I.e. take a look at the 3rd (possibly 4th if it treats it as zero indexed?) Pixel along the top row in an image editor:
- 是像素的红色或黑色(#FF0000或#000000)?
- 是否有255或0的α值?
如果答案是否,那么我想这是你的问题。那么这将明显地也需要被应用到所有其他标记像素周围的图像的边缘。
If the answer is "no", then I guess that's your problem. This will then obviously also need to be applied to all other marker pixels around the edge of the images.
我想补充这是一个注释,但没有足够的代表 - 遗憾
I'd add this as a comment, but don't have enough rep - sorry.
这篇关于9片图像prevent构建项目机器人工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!