1

Okay, I have spent several hours researching the issue with R not being resolved to a variable in eclipse for Android and still have not solved it. Here is what I have tried:

  1. No errors are appearing in any of my resources xml files.
  2. all xml files and image names are lower case.
  3. The java build path has Android 4.2.2 checked.
  4. None of the java files have "Import R".
  5. I have cleaned the project.
  6. Build Project is set to automatic...though I have tried building manually as well.
  7. Closed and re-opened eclipse.

I see by all my research that this is a common problem, but I cannot find the solution that works for me. Any idea's of what else I can try would be appreciated.

BriKau
  • 33
  • 6

4 Answers4

2

Most likely you got error in one of your xml files in res/ folder. it sometimes may not show up on Package Explorer tree as file with red error marker, but you may open Window -> Show View -> Problems view and investigate there, as whatever is causing R generation to fail, will be listed there.

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
  • The only errors that show up by clicking window > show view > problems are the R cannot be resolved to a variable. At the top of this view it says "213 errors, 0 warnings, 0 others (Filter matched 100 of 213 items)". Does this mean I am only seeing the first 100 of 213 errors? – BriKau Jun 25 '13 at 16:39
  • @user2284316 what's your adt version? is it rev 22? – Raghunandan Jun 25 '13 at 16:42
  • Yes. You got paging endabled. You can select these 100 (by clicking with SHIFT and then delete) to unvelil remaing ones, or disable paging by pressing "down arrow" (it's on right top area) then "Configure Contents" and then untick "Use item limits" – Marcin Orlowski Jun 25 '13 at 16:45
  • This didn't appear to be the issue, so I created a new android project and it has the same issue with the R variable as well. – BriKau Jun 25 '13 at 17:54
0

Errors in your XML file doesn't appear always. Check your all code line by line and try to find error. Also try Lint to see if there is any error or problem causing that.

For the Lint, right click on your project, go to Android Tools and click on Run Lint : Check for Common Errors

Gokhan Arik
  • 2,626
  • 2
  • 24
  • 50
  • This didn't appear to be the issue, so I created a new android project and it has the same issue with the R variable as well. – BriKau Jun 25 '13 at 17:56
  • Currently, in the new project, the only xml file is the hello world file that is auto-generated when you create a new project. – BriKau Jun 25 '13 at 19:08
0

Delete you project from eclipse. Don't delete it from disk otherwise you lost it.Then make new project with existing android project.Clean your project then your problem might get resolved.

Ponting
  • 2,248
  • 8
  • 33
  • 61
0

Make sure you have Android SDK Build-Tools installed from the Android SDK Manager.

It's the third item down.

See here for pictures.

Community
  • 1
  • 1
Ken Wolf
  • 23,133
  • 6
  • 63
  • 84
  • Ah well, that was my first guess. Bonus "off the wall" guess - make sure your directory doesn't have any permissions issues and everything is writable by everyone. Alternatively launch Eclipse with admin privileges. – Ken Wolf Jun 25 '13 at 18:02