Dmitry
Dmitry

Reputation: 161

Eclipse and ADT. The R.java file contains all that is expected, but Eclipse can't resolve anything

I have a primitive sample Android project and I already had that trouble when it could not re-generate R.java (it arbitrarily does or does not, you never know).

At one moment, it re-generated R.java and now it contains all that is expected (my layouts and string values), but Eclipse highlishts source files with red as if it can't resolve something.

R.java has the variable, my class references that variable, Eclipse says it "cannot be resolved or is not a field".

Or course, I tried first to clean the project but this obvious thing did not work. Then I deleted the project from the workspace and re-created it, and everything is the same again.

What can I do now with that to make it work?

Upvotes: 0

Views: 472

Answers (2)

Lars
Lars

Reputation: 4082

Check to make sure you are not accidentally including android.R

Upvotes: 3

moujib
moujib

Reputation: 752

Double check all your layouts and xml files , a malformed xml file can cause the R.java to net be recreated.

Can you post your layouts ?

Upvotes: 1

Related Questions