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

Android Build a Blog Reader Android App Adapting Data for Display in a List Finishing Our AsyncTask

Mauricio Pedraza
Mauricio Pedraza
1,148 Points

Problem with R.java class

Since a few videos ago, i started to get errors on any method related with R.java class. After tracking down this problem, I found this note in the Android documentation:


Note: Eclipse sometimes likes to add an "import android.R" statement at the top of your files that use resources, especially when you ask Eclipse to sort or otherwise manage imports. This will cause your make to break. Look out for these erroneous import statements and delete them.

While going through the Android sample tutorials, I would often use the Ctrl + Shift + O command to "Organize Imports" and generate any missing import statements. Sometimes this would generate the incorrect import statement which would hide the R.java class that is automatically generated when you build.

Please include this note in yours videos, because beginners like me get confused. Thanks

2 Answers

Ranjay Salmon
Ranjay Salmon
20,441 Points

Try checking your layout and other xml files to make sure they are lower caps and following proper naming conventions

Paolo Scamardella
Paolo Scamardella
24,828 Points

Make sure that you do not have any imports of R.java.class in all your files, and after do a clean in eclipse. Project(top navigation) -> Clean -> Select your project.