Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to convert @drawable/ into a drawable

I have added an image to my Android project which I want to use in the UI. I have added the file my-image.png to the drawable directory (to all 4 drawable directories created with the project), and added the ImageView to the layout:

<ImageView     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:id="@+id/imageView"     android:layout_alignParentBottom="true"     android:layout_alignLeft="@+id/textView"     android:layout_marginBottom="63dp"     android:src="@drawable/my-image" /> 

The problem is that I get the following error:

Rendering Problems

Failed to convert @drawable/my-image into a drawable

This is the capture:

enter image description here

Additionaly, if I try to compile the project, I get the following error:

Gradle: Execution failed for task ':MyProject:processDebugResources'.

Why do I get these errors and how can I solve it? Am I missing something? I've just started Android development.

like image 599
anderZubi Avatar asked Sep 18 '13 10:09

anderZubi


1 Answers

Gradle: Execution failed for task ':MyProject:processDebugResources'. 

because you have naming convention error in Resources

file name: must contain only [a-z0-9_.] 

Rename file name to my_image

like image 148
Tarsem Singh Avatar answered Oct 03 '22 23:10

Tarsem Singh