-5

Getting this error:

Error:(6, 22) No resource found that matches the given name (at 'background' with value '@drawable/aegis').

Edit. R.Java is missing apparently. Cleaning does not regenerate it (I've cleaned it a thousand times, literally). Here's the part I'm receiving errors.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:background="@drawable/aegis">
c0dezer019
  • 188
  • 2
  • 12
  • What did you follow? what are your previous suggestions? Did you ask a question earlier for similar issue? Where is your code? – VenomVendor Oct 31 '15 at 06:25
  • Do you have image named `aegis` in your `drawable` folder?! – Mohamed Oct 31 '15 at 06:26
  • @VenomVendor They were suggestions from others asking the same question. One suggestion involved lowering the build tools down a notch and the other was compiler but, doing those two methods didn't work. – c0dezer019 Oct 31 '15 at 06:27
  • Try to clean or rebuild the project from `Build > Clean project`, if the same problem still there please show the code. – Mohamed Oct 31 '15 at 06:30
  • 1
    You should consider updating the same question, instead of asking a new one. – VenomVendor Oct 31 '15 at 06:32
  • Possible duplicate of [Drawable Resource Not Found](https://stackoverflow.com/questions/17935813/drawable-resource-not-found) – Cœur Sep 12 '18 at 06:33

4 Answers4

1

Simply clean your project, so new added files to your drawable folder should be visible and you can see it when you just hovering your cursor to your imageview and press Ctrl, it will show that option for those images just like this and when clicking on it, it will be redirected to that image and that image will be open.

Lastly clean it and run it, it works.

enter image description here

Parth Bhayani
  • 1,894
  • 3
  • 17
  • 35
1

I fixed by moving project to Eclipse. My R.java file was apparently the problem and no matter what I did (everything was updated) it just wouldn't generate. Eclipse does not give me these issues.

EDIT

I decided to try and actually fix the issue I was having with Android Studio. Apparently AS did not like a few of my images where as AIDE and Eclipse had no problem at all with them. I simply deleted them and the R.java regenerated and all was right.

c0dezer019
  • 188
  • 2
  • 12
0

you did not share any codes so I do not know the exact problem but I think you should regenerate your R file and make sure that drawable contains the image and right xml.

mina
  • 71
  • 8
0

What file you are using in your drawable folder?
If it is an xml file or an image file, make sure it is available in the drawable folder.
If it is an image file, then use the imageView to set the background for the Relativelayout.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
shanta rao
  • 11
  • 2