• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps R cannot be resolved to a variable

aliblu

Lurker
My DroidAvtivity.Java file started with this error..."R cannot be resolved to a variable"...if you could please tell me what happened to my file?
 
Try Project->Clean. Also sure, what variable is declarated (ex. , if it's view id, check existence this id in xml)

If project get start, and error go down the drain, it's eclipse feature.
 
I have tried Project > Clean numerous times and it still has not resolved the issue. Other sites have said to reinstall the .android folder, remove the import R line, change the target of the run/debug for the project, turn automatic rebuild off, delete and recreate all AVDs, etc. but nothing has worked. Any ideas?
 
I hate this error, I have also had success with right click on project > android tools > fix project properties, but that is not work for me now. ahhhhh. I can't rebuild because my project has errors everywhere where I use R...
 
If there are errors in ANY of your resources, whether it be xml syntax, illegal file names, etc.., the R.java file will not be generated.
 
Back
Top Bottom