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

Invalid file name

I saved the Crystal Ball image to my computer and no matter where it was (User/My pictures, Pictures, even just C:) or what I titles the image (Crystal Ball, CrystalBall or ball01) it would give me the following error. 30:21 - Crystal Ball] res\drawable-mdpi\crystal ball.png: Invalid file name: must contain only [a-z0-9_.] I had no problems with anything else after that (bringing up the image, scaling it, moving to different phones, landscaping) until I tried to run it and it told me I needed to fix the error. How do I proceed?

4 Answers

It would still give me the error when I added the file ball01 for some reason, but when I made that the pic, it let me run it. Thanks.

Ben Jakuben - Can you shed any light on what's going on here?

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Glad you got it working, Jordan! Sounds like James pinpointed the issue. My guess was that something about your project became corrupted within Eclipse and needed some kind of jolt to be regenerated or deleted from cache or whatever. When changing resource files it's a good practice to clean and rebuild your project rather than a regular build, and in some cases you may need to completely uninstall and reinstall your app from your device or emulator.

That's telling the only valid file names are lowercase letters, numbers and the _ character.

but one thing I called it was ball01 and it still didn't work.

It's working now.