2 possibilities:
Clean your project (Project>Clean). This will probably also fix your R.java file.
Check your imports! Possible that you've imported the R class. Had lots of trouble with that too.
If you're really looking for an alternative, look at Assets.
EDIT
If the above doesn't fix it, check your res folder (incl subfolders) for suspicious files, and delete them. like for example files that won't open, have no extension, or have errors in them.