0

I have the R.java file generated but I'm still getting "R cannot be resolved" all throughout my code. Can anyone help? It is not a problem with the R.java file and there are no problems in the xml files

user1185205
  • 123
  • 1
  • 6

4 Answers4

2

A couple of options:

  • Make sure you import your R into the class (com.myactivity.R instead of android.R)
  • Sometimes other errors can prevent the R from generating. Fix those first, then R will regenerate and the R problems will disappear.
  • You could also try to do a clean of the project. In Eclipse this would be Project - Clean...
nhaarman
  • 98,571
  • 55
  • 246
  • 278
0

Try to Delete the R.Java, it will be automatically recreated & the issue will be resolved.

Yaqub Ahmad
  • 27,569
  • 23
  • 102
  • 149
0
  1. Check all your XML files
  2. Clean your project (Project > clean)
PeYoTlL
  • 3,144
  • 2
  • 17
  • 18
0

might be a problem in one of the XML files - have a look into the console - often errors show up there and tell you where to look

ligi
  • 39,001
  • 44
  • 144
  • 244