Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build an Interactive Story App (Retired) User Input Introducing ImageViews

failed to convert @drawable

Trying to upload images to the design but keep getting this error "failed to convert @drawable/._main_title into a drawable. Ive tried using a different device and API nut nothing works. Ive also restarted Andriod Studio and nothing works

3 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Hi Braeden,

"._main_title" is an illegal file name for images in Android because of the "." character. Is this a file you've downloaded or named yourself? It should generally be like @drawable/main_title

This was the name that came with all of the files in the teachers notes under your videos! I have fixed the problem! Thx! Your videos are great!

I had the same error with PROPER file name. I think the new version of the Android Studio punked me. The files couldn't be reached by the ImageView src property, while they were in the oldschool four-folder structure. My Android Studio can only use files from the drawable directory itself. It's not just like there's no need for the 4 different directories for different dpi pictures, it does not even work that way.

Roseanna Grundy
PLUS
Roseanna Grundy
Courses Plus Student 584 Points

I'm having difficulty with the correct filename on the most recent Android Studio (as of this date). I will move the images to the drawable folder to see if that helps.

Roseanna Grundy
Roseanna Grundy
Courses Plus Student 584 Points

Got it working, not sure what the cost is. I moved all xxhdpi images to the 'drawable' folder. I deleted the other drawable-* folders. After cleaning project, the image appears.