【问题集】点9图(9-patch image)导致的"No resource found"
来源:互联网 发布:java 什么是异常 编辑:程序博客网 时间:2024/06/13 13:59
错误现象:
默认打包都没问题.而且都可以运行.而用 ant的build.xml文件进行打包编译时出现以下错误:
error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/xxx').
分析:
一般是因为你的项目中的图片出了问题,最有可能的就是9-patch image出现问题,导致ant解析不了。
看LOG你会找到如下描述:
ERROR: 9-patch image ****.9.png malformed.
或 No marked region found along edge.
以及 Found along top edge.的错误
主要是因为该图片没有四周的定位像素。
至少必须在左边和上方定位像素。
解决方案:
- 检测点9图的边上是否有1px的边距(目测没有)
- 找到原图重新切图,让原图的边上加上1px的空白(用来拉伸)。
- 将新的有边距的图,切点9.
- 替换工程中对应点9图。在运行,错误应该就解决了。
0 0
- 【问题集】点9图(9-patch image)导致的"No resource found"
- [exec] ERROR: 9-patch image xxx.9.png malformed. [exec] No marked region found along edge.
- [exec] ERROR: 9-patch image xxx.9.png malformed. [exec] No marked region found along edge.
- android 9patch背景图片导致的一个文本显示问题
- No resource found that matches the given name 9png
- android:9-patch image error
- Android Process bar的自定义进度条 使用9 patch导致直接无法显示进度的问题
- Android Studio 上Bad 'Patches' in 9-Patch和not found file *.9.png的问题
- 关于 No resource found that matches the given name 'Theme.AppCompat.Light'问题的解决
- Android报No resource found that matches the given name问题的解决
- 出现的问题:error: No resource identifier found for attribute 'layou_width' in package 'android'
- error: No resource identifier found for attribute 问题
- Draw 9-patch(点9图)
- dlopen “no suitable image found ”问题之解决
- No resource found android:WindowTitleBackground
- <nine-patch> requires a valid 9-patch source image
- 9-patch image ....9.png malformed
- Error:No resource found that matches the given name (at 'icon' with value '@mipmap/ic_launcher.9').
- JavaScript 通过ClassName获取元素
- GOF 23设计模式之 桥接模式
- ACM_种类并查集
- 幸福
- 安卓:Handler实现图片轮播(非ViewPager)
- 【问题集】点9图(9-patch image)导致的"No resource found"
- xib中设置圆角,边框宽度,边框颜色等
- 软件静态测试
- HDOJ 题目3037 Saving Beans(Lucas定理)
- java连接sql server 2008和连接sql server 2008
- 7. --SQLite 专属的条件查找
- MT7620sdk_sdram配合不当导致系统在uboot挂死
- 8. --SQLite 删除整个表
- 解决Android Studio打开别人包时出现Failed to find: com.android.support:appcompat-v7:21.