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 Build an Interactive Story App User Input Introducing ImageViews

Christopher Herring
Christopher Herring
1,432 Points

Why are my images missing when I use imageView?

I am on the Android interactive story course. I downloaded some images from Treehouse, as instructed in the video, and I moved them into the res folder, also as instructed by Treehouse. Although, when I use imageView from the Palette of Android Studio, most if not, all of my images are missing. Does anybody know why?

2 Answers

Cam Richardson
seal-mask
MOD
.a{fill-rule:evenodd;}techdegree
Cam Richardson
Front End Web Development Treehouse Moderator 16,894 Points

I've had this issue as well. Whenever I go to choose an image source for a view the project images that I added will be missing. The resolution is to choose Build > Clean Project then Build > Rebuild Project or to re-sync your project with Gradle or to choose File > Invalidate caches/Restart. Afterwards when I go and try to pick an image my project resources will then show up.

Mike Swartz
Mike Swartz
566 Points

I'm having the same issue. I can see the png's are inside the drawable folder in the sidebar, so it looks like they were loaded into the res/drawable/ folder(s) just fine. But when I add the image view and try to choose one of the drawables, none of them are listed in any of the folders. It does show the mipmaps however, which is weird. Feel like I can't continue the tutorial until I figure this out.

Mike Swartz
Mike Swartz
566 Points

Update: Cleaning then building failed, but Cam's tip to Invalidate & Restart worked! Back on track. Thanks Cam.