简体   繁体   中英

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?

检查以确保您没有意外包含android.R

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 ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM