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
thank you~~your article resolves my problem....
Good Point. Thank you
Worked like a charm, thanks!
Oh my god, thanks, I've been scratching my head for hours. Thank you very much for taking the time to share this.
still didn't worked for my project.i have given name as all rule but still not working.i have restarted android studio still not working..plzzz help me...
Comments are closed.