当前位置: 代码迷 >> Android >> 用 Ant 打包Android项目时 ,因资源文件中包含.9.png 报错 ,
  详细解决方案

用 Ant 打包Android项目时 ,因资源文件中包含.9.png 报错 ,

热度:59   发布时间:2016-05-01 22:04:55.0
用 Ant 打包Android项目时 ,因资源文件中包含.9.png 报错 ,急求救啊
错误提示如下:
Buildfile: E:\workspace\eclipse_370\mycc\build.xml
generateAPK:
init:
  [echo] Initializing all output directories...
gen-R:
  [echo] Generating R.java from the resources...
  [exec] ERROR: 9-patch image res\drawable-hdpi\bg_button1.9.png malformed.
  [exec] Frame pixels must be either solid or transparent (not intermediate alphas).
  [exec] Found at pixel #2 along bottom edge.
  [exec] ERROR: Failure processing PNG image res\drawable-hdpi\bg_button1.9.png
  [exec] res\layout\main.xml:12: error: Error: No resource found that matches the given name (at 'background' with value [email protected]/bg_about_btn').

BUILD FAILED
E:\workspace\eclipse_370\mycc\build.xml:227: The following error occurred while executing this line:
E:\workspace\eclipse_370\mycc\build.xml:106: exec returned: 1


Total time: 1 second

只是在用ant脚本来编译的时候有错,如果直接用eclipse打包就没有问题!

这个问题弄了一下午了,都没弄清楚了,还望各们大牛们赐教哇 !!!

------解决方案--------------------
那张图有问题,用9图工具打开重新保存,应该就可以了
------解决方案--------------------
:Found at pixel #2 along bottom edge.
可能是图片下边沿那条线有问题,重画下试试
  相关解决方案