Jump to content

  • Log In with Google      Sign In   
  • Create Account


Android / Eclipse "R cannot be resolved to a variable"


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 chiranjivi   Members   -  Reputation: 195

Like
0Likes
Like

Posted 02 April 2011 - 10:02 PM

Trying to learn Android, I've downloaded some of the provided example open-source games to have a look at the code and try to mess around with them a bit. I got the source for Snake and a couple of other simple games from the developers wiki, but I cannot get any of these projects to work in Eclipse. After having imported them, if I try to build them I get a ton of 'R cannot be resolved to a variable' errors. After having Googled this error, it appears that it is usually caused by Eclipse adding an incorrect import to files containing resources...

http://stackoverflow...d-android-error

...but after having searched every file in the created project I can't find this import line that in theory causes this error. I don't know what else to try, but I'm entirely new to Android and I'm sure the solution must be very obvious to anyone who has a clue...?

Thanks

Sponsor:

#2 SriLumpa   Members   -  Reputation: 198

Like
1Likes
Like

Posted 03 April 2011 - 01:27 AM

R is an auto generated class. Do you have the Android plugin installed, is your project an Android project, and did you activate automatic build ?
If so you should have R.java in some folder named "gen". If not, look again at that Stack Overflow post, many possible solutions to that are mentioned there.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS