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
Erik Russell1,032 Points
Cannot locate R file
So far the lesson is going great. I am having one issue however, I cannot locate the R file as I have an updated version of Android Studio. The build folder is missing along with all other files and folders inside of it.
Could somebody please advise on where to locate the R file. Thanks.
Ah, right - sorry I was on the wrong track.
The files are still there, but the newer versions of Android Studio organise them differently than in that video.
On the top, left above your files listing, there is a drop-down that is probably set to show the Android robot icon with the word Android next to it. Click the drop down and change it to Project and you'll get the full path from app such as
Switch to Packages, and the R files is shown under the
android.support package, if you're using that.
Hope that makes sense now!
That is auto-generated. Try a "Invalidate Caches and Restart" - that usually fixes stuff like that.
If that doesn't work do let me know and we can think again!
Have you tried cleaning and then building the project?
There are some useful pointers in this Stack Overflow post.
Your solution is likely to be in there somewhere.
The R.java is created by the compiler; you never (as far as I'm aware) change any code in it. We reference it when accessing application resources, menus and layouts.
If you've got this auto-generated stuff missing, which is odd, try a rebuild, or a make or a clean - try it all!
Having the Same Problem,
Try doing this tutorial with the latest android studio, the whole directory structure is different so things are harder to find or are not there anymore.