Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android

pdiaz
pdiaz
16,073 Points

Image Problem

Hey guys, I need help to import a picture I created from gimp into eclipse. I keep getting an error from the console log that reads "Invalid file name: must contain only [a-z0-9_.]". What should I do? Any help would be much appreciated.

It pays to think about how you're going to name your assets before building your application (otherwise it can get messy!), however it's ultimately down to you what you want to call it.

Personally I'd name it something like 'img_bknd' or simply 'bknd'. The main thing is the name differentiates it from your other assets and describes what it is at a glance. Hope this helps!

pdiaz
pdiaz
16,073 Points

It's still not working, I don't know what to do cause I have also tried using web images and it keeps giving me the same error.

Q1) What format is the image in? (jpg, png, tiff etc.) Q2) What have you named it? Q3) Talk us through the steps you're taking to import the image into your project.

I have to sleep but hopefully someone else will be able to help with this info ^^

pdiaz
pdiaz
16,073 Points

The format is in xcf. and I named it img_bknd. Lastly, I dragged the image into the mdpi

Ah, xcf is the GIMP file format - instead of going "File > Save As..." you'll need to go to "File > Export As..." and use a format like jpg or png.

pdiaz
pdiaz
16,073 Points

Thanks that worked

Good stuff! :)

1 Answer

Change the file name.

pdiaz
pdiaz
16,073 Points

change it to what?

What is the image of/what's it for?

pdiaz
pdiaz
16,073 Points

It's for the background of my app