Couldn't resolve resource @drawable/homebackground

android, android-drawable

Solution

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

Problem

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 My res folder structure is 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

Original source

Related problems