关于android.content.res.Resources$NotFoundException: Resource is not a Drawable 问题的解决办法
来源:互联网 发布:linux解压tar.bz2命令 编辑:程序博客网 时间:2024/06/06 03:39
问题描述:做了一个安卓TV的应用,由于涉及到底层API的调用,所以先在Eclipse中编译好可执行的代码,然后再添加上底层API,最后在安卓源码中编译。但是编译安装后出现如题中所示的问题。
解决过程:
1.在查找解决方案的过程中,发现eclipse编译的安装包是6M,安卓源码编译的是1点多M,所以猜想是不是资源文件没有打包到安装包中。
2.尝试将各个资源改成@null,最后可以显示主界面,但是执行其他操作还是出现题目中的错误。
3.后来在网上找到一个解决办法,就是将资源文件在每一个drawable(h,l,m,xh,xxh)文件夹中都复制一份。
4.执行3步骤之后,再次在源码中编译,安装之后程序正常工作。。问题解决
分析:
1.问题出现的原因确实是因为资源文件没有打包在安装包中,所以才会报题目中的错误。
2.原因是:因为我的程序运行在安卓TV中,但是我的资源文件全部在m-drawable中,xh和xxh中却没有相应的资源文件。所以才会出现找不到合适的资源文件问题。
总结:
说到底,还是分辨率适配问题,不同的分辨率要适配不同的资源文件。
0 0
- 关于android.content.res.Resources$NotFoundException: Resource is not a Drawable 问题的解决办法
- android.content.res.Resources$NotFoundException: Resource is not a Drawable
- android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedVa
- 已解决_Android_Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (
- android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path)
- Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or pat
- android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedV
- android.content.res.Resources$NotFoundException: Resource is not a ColorStateList (color or path): T
- 关于android.content.res.Resources$NotFoundException: Resource ID #0x**********的问题
- android.content.res.Resources$NotFoundException:Resource ID #0x7f080004 type #0x12 is not valid问题解决
- android.content.res.Resources$NotFoundException: Resource ID #0x7f09000a type #0x12 is not valid
- 关于Android中android.content.res.Resources$NotFoundException: String resource ID #0x9这类问题的解决
- android.content.res.Resources$NotFoundException: String resource ID #0x6错误的解决办法
- 关于android.content.res.Resources$NotFoundException: String resource ID #0x1错误的产生
- android.content.res.Resources$NotFoundException解决办法
- 异常:android.content.res.Resources$NotFoundException:String resource ID #0x86的问题
- android.content.res.Resources$NotFoundException错误的解决办法
- android.content.res.Resources$NotFoundException: File res/drawable/ripple_round_blue.xml
- 如何按照类中的某个属性值进行排序
- scala play处理json
- 百钱买百鸡
- 接口和抽象类不能实例化对象
- Android UI性能优化实战 识别绘制中的性能问题
- 关于android.content.res.Resources$NotFoundException: Resource is not a Drawable 问题的解决办法
- Android基础——Fragment与Activity交互
- 涉及String类笔试题练习
- Java从.CSV文件中读取数据和写入
- C语言中变量存放位置分析
- http 2.0协议简介
- java开发中文件操作的问题!!
- 解决ASP.NET网站“发布后”提示“用户 'NT AUTHORITY\IUSR' 登录失败。”问题
- 【行业科普】一篇文读懂四大、咨询、投行、PE