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.

MUZ140190 Tinashe Chinyanga
7,406 PointsImages in drawable folder cannot be referenced
In the interactive story app, referencing the images using the R.drawable.image_name call is giving an error, cannot resolve image_name.
The drawable folder has all the necessary images and these are appearing as well when the image is double clicked.
How can this be rectified?

Antonis Tsagaris
17,511 PointsHave you tried cleaning your project?

MUZ140190 Tinashe Chinyanga
7,406 PointsR.drawable.page1 were page1 is the name of the image
2 Answers

MUZ140190 Tinashe Chinyanga
7,406 PointsFixed it guys, changed the location of the images. The images were in a folder, cut them from those folders and pasted them directly into the drawable folder.

Alexander Teitelboym
7,761 PointsBe careful with the drawable folder. as it may either make the images look bad on some devices or even not display them at all.
you should only use drawable-[ldpi|mdpi|hdpi|xhdpi|xxhdpi|xxxhdpi].
p.s. why am i getting a negative point for trying to help?

Alexander Teitelboym
7,761 Pointstry File -> Invalidate caches and restart.

MUZ140190 Tinashe Chinyanga
7,406 PointsThanks, however the issue is still persisting.
Jon Kussmann
Courses Plus Student 7,254 PointsJon Kussmann
Courses Plus Student 7,254 PointsCan you show how you are trying to reference the images?