Failed to resolve @ drawable / homebackground resource

I created a new project in Android Lollipop (API 21) using Studio (64) and Java 7. When I try to add the background to the main layout (relative layout), I get an error

enter image description here

My res folder structure

enter image description here

NOTE. I placed 720x1280 img in all available * folders.

My xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" android:padding="0dp" android:background="@drawable/homebackground"> </RelativeLayout> 

I tried using PNG / JPG .. but still I get the same error. Can someone tell me where I'm wrong?


I called it, but they are not related to my problem or do not solve my problem.

Failed to resolve resource @ drawable / backround.png

RelativeLayout "Unable to resolve resource ..." Android

Android image cannot be converted to graphic

+6
source share
2 answers

If you are using Android Studio, clicking on File> Invalidate caches / restart should fix the problem.

+9
source

Inside the manifest file ..... in the field where there is @ drawable / homeground , replace it with @android: drawable / homeground

0
source

Source: https://habr.com/ru/post/982841/


All Articles