Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Couldn't resolve resource @drawable/homebackground

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

enter image description here

My res folder structure is

enter image description here

NOTE: I have placed 720x1280 img in all drawable* folders.

My XML is

<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 am getting same error. Can someone tell where am I going wrong ?


I referred these, but they are not related to my problem or don't solve my problem

Couldn't resolve resource @drawable/backround.png

RelativeLayout "Couldn't resolve resource..." Android

Android image can't convert to drawable

like image 203
SimpleGuy Avatar asked Feb 22 '15 09:02

SimpleGuy


1 Answers

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

like image 93
GunnerFan Avatar answered Oct 05 '22 02:10

GunnerFan