I can not add image. I uploaded the image and added it to the res directory in drawable-mdpi. Then, when I try to add an image to the view using imageView, it gives me this error
Couldn't resolve resource @drawable/ball01 Failed to convert @drawable/ball01 into a drawable
Here is my xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" tools:ignore="MergeRootFrame" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/textView" android:layout_gravity="center" android:textSize="32sp" android:layout_above="@+id/button" android:layout_centerHorizontal="true" /> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Enlighten Me" android:id="@+id/button" android:layout_centerVertical="true" android:layout_alignParentRight="true" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imageView" android:layout_above="@+id/textView" android:layout_centerHorizontal="true" android:src="@drawable/ball01" /> </RelativeLayout>
What am I doing wrong here.
source share