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?

4

5 回答 5

1

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

于 2013-09-23T19:04:00.857 回答
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.

于 2013-09-23T16:52:41.973 回答
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

于 2013-09-23T16:53:26.910 回答
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
于 2013-09-23T16:54:37.847 回答
0

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

于 2013-09-23T17:03:21.833 回答