[英]No resource found that matches @drawable/test err android studio
I've tried all solutions. 我已经尝试了所有解决方案。 Finally decided to post this question. 最终决定发布这个问题。
The situation is as follows: 情况如下:
My drawable has test.png image which I use in my project. 我的drawable具有在项目中使用的test.png图像。 In eclipse it works perfectly but in Android Studio it doesn't work. 在eclipse中,它可以完美运行,但在Android Studio中,则不起作用。 Also I'm not getting any compiler error. 另外我没有得到任何编译器错误。 I am getting only this type of error almost 54 times when cradle build. 当通讯座建立时,我几乎只遇到过54次此类错误。 As this image is set of as background to 54 screens. 由于此图像被设置为54个屏幕的背景。 :( What could be the problem? :( 可能是什么问题呢?
You need to reference your drawable without the extension: Like this: 您需要引用不带扩展名的可绘制对象:
android:src="@drawable/test"
Remove the image extension from your xml file and try that please! 从您的xml文件中删除图像扩展名,然后尝试!
You should remove the extension part. 您应该删除扩展部分。
For example if your image is called mimg.png in your 例如,如果您的图片在您的图片中称为mimg.png
resource files you should access it via @drawable/mimg. 资源文件,您应该通过@ drawable / mimg访问它。
Edit 编辑
If in eclipse is fine, then create the project new and add file by file. 如果在eclipse中可以,则新建项目并逐个文件添加。 I also had this issues and after some tries ai gave up and created new and after added file by file. 我也遇到了这个问题,经过一番尝试,ai放弃了,创建了新文件,然后逐个文件添加。
As an alternative please check if you add it in other drawables folders. 或者,请检查是否将其添加到其他drawables文件夹中。
That's it. 而已。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.