ant 打包Android Error:No resource found that matches the given name

============问题描述============




     [exec] ..\res\layout\vw_custom_title.xml:8: error: Error: No resource found that matches the given name (at 'background' with value '@drawable/btn_title_back_big').
     [exec] ..\res\layout\vw_custom_title.xml:22: error: Error: No resource found that matches the given name (at 'background' with value '@drawable/background_title_button_home').
     [exec] ..\res\drawable\add_illegal_button.xml:3: error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/add_illegal_tapped').
     [exec] ..\res\drawable\add_illegal_button.xml:6: error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/add_illegal_tapped').

默认打包都没问题.而且都可以运行.而且把这个ant的build.xml文件放到其他工程下面也可以通过编译.
 就是放到我需要build的项目下面就报这个错误.哪里问题呢???
 在线求解

============解决方案1============


1.错误现象:
默认打包都没问题.而且都可以运行.而用 ant的build.xml文件进行打包编译时出现以下错误:
 error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/xxx').
2.分析:
一般是因为你的项目中有些图片出了问题,ant解析不了。不一定就是错误日志中所显示的图片有问题(如xxx),也可能是其他的图片有问题。
3.解决方案:
找出问题图片(推荐使用Photoshop将项目中所使用的图片进行一一打开,如Photoshop打开一图片时出错,则该图片肯定有问题),将该图片删除或替换成没问题的图片。再重新ant打包即可。

============解决方案2============


此类问题确定为资源文件有问题,如果控制台无法看到是哪个资源文件造成的错误,可以在eclipse中设置日志的长度,以便查看到最顶部的日志,确定是哪一个资源文件报错

============解决方案3============


同样的问题,原因是有的图片有问题造成的

转载于:https://www.cnblogs.com/lianxu61/p/4030407.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值