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 trialadsdev
15,583 PointsAndroid 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 :/
2 Answers
James Simshaw
28,738 PointsHello,
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".
adsdev
15,583 Points@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 ^^
Sanat Tripathi
8,109 PointsSanat Tripathi
8,109 PointsSo you are saying that even if you add a name like this: "@+id/element_name", in your layout file, you still get an error?