0

All of a sudden I'm getting an error stating: R Cannot Be Resolved To A Variable over 200 times in my project.

Thus far I have:

  • Rebooted Eclipse
  • Cleaned The Project
  • Deleted The .R Errors and Attempted to Run Anyways
  • Turned off Build Automatically and Built The Project (again)

I'm not sure why this is happening or what I can do to resolve the issue other than what I've already tried.

Does anyone else have any additional suggestions?

Joshua Ulrich
  • 173,410
  • 32
  • 338
  • 418
Wendy
  • 77
  • 3
  • 8
  • i think that is something with the build path. Could you check your projects "Java Build Path", tab "Order and Export" and checkmark "Android 4.2.2" I remember i had that issue too, and i solved it that way (or similiar) – nouseforname Sep 23 '13 at 16:52
  • see any error in layout files... – Abhijit Chakra Sep 23 '13 at 16:58

5 Answers5

1

this can be due to wrong namming convention in drawables. Please check your error log (not logcat) and fix from there

vaibhav kumar
  • 414
  • 2
  • 11
0

This typically occurs when there is an error in any of your XML (layouts, strings, etc). I've also seen it happen when there are classpath issues, or the wrong version of android is selected.

Also, did you recently update your Android tools? If so, make sure you have all the latest (build-tools, platform-tools, eclipse adt plugin) and that the versions are in sync.

invertigo
  • 6,336
  • 5
  • 39
  • 64
0

Usually this means that the file R.java is not getting generated, so eclipse cant find it in your project. You could check if you have errors in your XML files like layouts and so, because if there is an error in the XML files, the R.java file is not going to be generated.

Also, check this another question that has already answers for your problem: R.Java not generated

Community
  • 1
  • 1
Adrián Pérez
  • 2,186
  • 4
  • 21
  • 33
0

Have you checked these similar looking questions\issues yet?

  1. R cannot be resolved to a variable eclipse android
  2. Cannot be resolved to a variable error in Eclipse
Community
  • 1
  • 1
Trey Jonn
  • 350
  • 3
  • 17
0

The issue was caused by an uppercase filename in my drawable folder.

Wendy
  • 77
  • 3
  • 8