Failed to resolve resource @ drawable / backround.png

I recently tried to learn how to develop Android, and I ran into two problems. They

Failed to convert @drawable/backround.png into a drawable Couldn't resolve resource @drawable/backround.png 

Heres My XML File

 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:background="@drawable/backround.png" android:layout_height="fill_parent" android:orientation="vertical" > </LinearLayout> 
+2
source share
4 answers

Restart Eclipse (unfortunately) and the problem goes away.

(Android Studio: File --> Invalidate caches/Restart... )

this ask: Android: failed to convert @ drawable / picture to drawing

+6
source
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:background="@drawable/backround" android:layout_height="fill_parent" android:orientation="vertical" > </LinearLayout> 

There is no need for extensions. just specify a name without extension

+5
source

replace background.png with background

  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:background="@drawable/backround" android:layout_height="fill_parent" android:orientation="vertical" > </LinearLayout> 
0
source

Change

 android:background="@drawable/backround.png" 

with android:background="@drawable/backround" and make sure the background image is present in your drawing folder

0
source

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


All Articles