Android Error Fix: Failed to convert @drawable/ into a drawable

While trying to add an icon from the Android Developer Icon Pack to a button’s android:drawableLeft property, I kept getting this error:

Failed to convert @drawable/10_device_access_camera into a drawable
Exception details are logged in Window > Show View > Error Log

java.lang.NumberFormatException: Color value '@drawable/10_device_access_camera' must start with #

Some people have mentioned restarting Eclipse has worked, but that didn’t work for me.

Instead, I found that I had to simply rename the image file so that it did NOT start with a number. All icons in the Android Developer Icon Pack start with a number, and I had just copied the one over. It appears that if the file starts with a number, it is assumed to be the start of a hexadecimal color value, and hence looks for the # symbol.

working with: Eclipse Juno 3.7.2, Android SDK 21.1

5 comments on “Android Error Fix: Failed to convert @drawable/ into a drawable

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

*