R cannot be resolved to a variable

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

R cannot be resolved to a variable

Postby Seeshi_suin » Sat Apr 23, 2011 4:38 am

I know this problem shows up all the time but I googled it and could not find a solution that would work. Initially my program was pulling a "array cannot be resolved to a variable" so I exported and re-imported the file and now it is giving me the "R cannot be resolved" error. I cleaned the project, checked for erroneous import statements and all that and the error refuses to budge. What a pain, any more ideas?
Seeshi_suin
Freshman
Freshman
 
Posts: 8
Joined: Thu Mar 31, 2011 6:03 am

Top

Re: R cannot be resolved to a variable

Postby ankit116 » Mon Oct 29, 2012 5:59 pm

go to gen folder>R.java

delete it

and clean your project ! :)

R.java will be automatically generated and your error will be removed but before that check your syntax setContentView(R.layout.main);
ankit116
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Oct 29, 2012 5:55 pm

Re: R cannot be resolved to a variable

Postby Ahylkova » Thu Sep 05, 2013 6:35 pm

Many thanks for sharing good info…!!!)
Ahylkova
Junior Developer
Junior Developer
 
Posts: 15
Joined: Wed Sep 04, 2013 9:23 pm

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 6 guests