简体   繁体   中英

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. In eclipse it works perfectly but in Android Studio it doesn't work. Also I'm not getting any compiler error. I am getting only this type of error almost 54 times when cradle build. As this image is set of as background to 54 screens. :( 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!

You should remove the extension part.
For example if your image is called mimg.png in your
resource files you should access it via @drawable/mimg.
Edit
If in eclipse is fine, then create the project new and add file by file. I also had this issues and after some tries ai gave up and created new and after added file by file.
As an alternative please check if you add it in other drawables folders.
That's it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM