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 Simple Android App (retired 2014) Getting Started with Android Android Setup and the Crystal Ball Project

James B
James B
229 Points

Error in Eclipse When Opening new Android Project

I get two errors on the problems tab before I make any modifications. Both are for this;

R cannot be resolved to a variable

On lines 12 and 18 of MainActivity.java .

I'm using the SDK supplied in the teachers notes (Windows 64 bit)

This is in the "src" directory, not the "res" directory. But shows up as an error regardless.

Help?

3 Answers

James B
James B
229 Points

Yes. I have the windows 64 bit android platform installed.

After poking around online, the problem may be related to "R" not being created under the "gen" folder.

Which step do you believe I may have missed?

James B
James B
229 Points

I ended up just switching over to Android Studio to progress in the lessons. Wasn't able to get Eclipse to generate the R file.

Hi James,

Have you read the "Teacher Notes" yet on the video page here? I think it might solve some of your problems.

Ryan