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
MOD
Cam Richardson
Front End Web Development Treehouse Moderator 16,885 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.

Jeremiah Shore
Jeremiah Shore
31,168 Points

Clean Project was enough for me; I'm in Android Studio 3.2.1

Adrian Ragen
Adrian Ragen
3,062 Points

This worked for me also. Thank you.

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.