关于android.content.res.Resources$NotFoundException: Resource is not a Drawable 问题的解决办法
2015-05-12 17:55
1016 查看
问题描述:做了一个安卓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中却没有相应的资源文件。所以才会出现找不到合适的资源文件问题。
总结:
说到底,还是分辨率适配问题,不同的分辨率要适配不同的资源文件。
解决过程:
1.在查找解决方案的过程中,发现eclipse编译的安装包是6M,安卓源码编译的是1点多M,所以猜想是不是资源文件没有打包到安装包中。
2.尝试将各个资源改成@null,最后可以显示主界面,但是执行其他操作还是出现题目中的错误。
3.后来在网上找到一个解决办法,就是将资源文件在每一个drawable(h,l,m,xh,xxh)文件夹中都复制一份。
4.执行3步骤之后,再次在源码中编译,安装之后程序正常工作。。问题解决
分析:
1.问题出现的原因确实是因为资源文件没有打包在安装包中,所以才会报题目中的错误。
2.原因是:因为我的程序运行在安卓TV中,但是我的资源文件全部在m-drawable中,xh和xxh中却没有相应的资源文件。所以才会出现找不到合适的资源文件问题。
总结:
说到底,还是分辨率适配问题,不同的分辨率要适配不同的资源文件。
相关文章推荐
- android.content.res.Resources$NotFoundException: Resource ID解决办法
- 关于Android中android.content.res.Resources$NotFoundException: String resource ID #0x9这类问题的解决
- Android报Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0 .解决办法
- 已解决_Android_Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (
- Android报Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0 .解决办法
- android.content.res.Resources$NotFoundException: Resource ID解决办法
- Android问题解决记录—android.content.res.Resources$NotFoundException: Unable to find resource ID
- AndroidRuntime Caused by: android.content.res.Resources$NotFoundException: String resource I解决办法
- android.content.res.Resources$NotFoundException:Resource ID #0x7f080004 type #0x12 is not valid问题解决
- [糊里糊涂解决] android.content.res.Resources$NotFoundException: File res/drawable/selector_edit.xml fro
- 【已解决】android.content.res.Resources$NotFoundException: String resource ID
- android.content.res.Resources$NotFoundException: File res/drawable/*.xml from drawable resource ID
- 异常:android.content.res.Resources$NotFoundException:String resource ID #0x86的问题
- Android 常见问题之 android.content.res.Resources$NotFoundException: Resource ID 解决方案
- android.content.res.Resources$NotFoundException: Resource is not a Drawable
- android.content.res.Resources$NotFoundException错误的解决办法
- android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedVa
- android.content.res.Resources$NotFoundException: String resource ID #0x6错误的解决办法
- [Android][Fatal Exception] android.content.res.Resources$NotFoundException 问题及解决方法