AIntel
AIntel

Reputation: 1117

Android R.java not being recognized properly

I am having problems accessing the elements within the classes in the R.java file. I recently reformatted my computer and when I reinstalled eclipse, the proper sdks, and imported the proper files I am left with errors that prevent me from accessing my xml files. For example:

R.layout.my_layout will not be able to find "my_layout." In fact I can't access R.id, R.string nothing! The R.java file looks okay, everything is in there and I'm not getting an error for R or id/layout/string etc. its just the elements within the class that are unable to be found for some reason. Here is an actual error example:

Description Resource Path Location Type main cannot be resolved or is not a field CatalogNumber.java "package name"

"main" is an xml file in layout. I actually just noticed that it does not exist in the R.java file however there are some xml files that are represented there that are still giving errors. What do you think?

Upvotes: 1

Views: 2326

Answers (1)

jbgamer
jbgamer

Reputation: 118

First please go to project > clean. If this doesn't work look at your imports and if there is an import R. Android might have deleted it. Also check your xml files. One of them may have an error.

Upvotes: 1

Related Questions