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 studio is giving me a bad time

Hello. Everytime i start an android project in Android studio, and I go work on it. I find out no R.Java file is created and when in the normal code it is referencing to it. At least this is the impression i get. Also when i put in an ID in like a textView android:id ="@+id/" it gives me a missing resource error. I really don't know what to do :/

So you are saying that even if you add a name like this: "@+id/element_name", in your layout file, you still get an error?

2 Answers


The R.java file is automatically created when you build your project and you should never really have reason to mess with it. As for the resource id error, you cannot give an id that is blank, which is what you are trying to do with just "@+id/", you need to give it a full name like "@+id/someUniqueName".

@Sanat, yep. But i had to change some things in Android studio itself. It probably was a common problem. few things i had to do was clean and rebuild my project. Thanks for your time thuogh :), u 2 james ^^