简体   繁体   中英

android - “id cannot be resolved or is not a field” - error after cleaning project

Picture one:

http://www.directupload.net/file/d/3572/gkx2b7ge_jpg.htm

IMG

Picture two:

http://www.directupload.net/file/d/3572/knljgb8m_jpg.htm

IMG

Hey Community.

I have a Problem as follows: After i cleaned my Project Test2 in Eclipse, Eclipse doesn`t seem to find any views or xml files from R.java anymore.

The Problem message for every view or xml:

"view name or xml" cannot be resolved or is not a field.

What i've tried so far:

  • I cleaned the project several times, and built it again - doesn't work.
  • I disabled automatic building and tried again - does´t work.
  • I deleted the project from the workspace and imported it again - doesn't work.
  • I deleted Eclipse, set up a whole new workspace and imported my project - doesn't work.

I tried this solution ( "id cannot be resolved or is not a field" error? ) checking if i imported R manually. Which i did. After i took it out of the code the problem is still there though.

Trying to update Eclipse failed. It seems to not find any updated.

My code was working fine just before i cleaned the Project. As you can see in the second Picture, there is no errors concerning any other Problems.

If R does not generate after a build anymore. It means that you have errors in your xml files.

Try right click on your project -> click Android Tools -> Fix Project Properties

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