简体   繁体   English

找不到与@ drawable / test err android studio匹配的资源

[英]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.

相关问题 Android Studio找不到资源@drawable - Android Studio No resource found @drawable 在Android Studio中构建项目时出错“错误:找不到与给定名称匹配的资源(在____处使用值&#39;@ drawable / <name> “) - Error Building Project in Android Studio "Error: No resource found that matches the given name (at ____ with value '@drawable/<name>') 找不到与名称匹配的资源-Android Studio - No resource found that matches the name - Android Studio Android Studio-找不到与给定名称匹配的资源 - Android Studio - No resource found that matches the given name Android Studio:未找到与给定名称匹配的资源:attr&#39;android:actionModeShareDrawable&#39; - Android Studio : No resource found that matches the given name: attr 'android:actionModeShareDrawable' Android错误:找不到与Android Studio中的给定名称匹配的资源 - Android Error: No resource found that matches the given name in Android Studio 在 package 中找到 0 个测试类 Android Studio 中的“可绘制”错误 - 0 test classes found in package 'drawable' Error in Android Studio 问题Android Studio找不到与给定名称匹配的资源 - Problems Android studio No resource found that matches the given name 错误未找到与给定名称匹配的资源:Android Studio中的attr&#39;borderWidth&#39; - Error No resource found that matches the given name: attr 'borderWidth' in Android Studio 字体android studio 3错误:找不到与给定名称匹配的资源 - Error with fonts android studio 3: No resource found that matches the given name
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM