How to force eclipse to recreate the R (=resources) file?
I just had the odd case that my Android project for some reason would not properly rebuild in Eclipse (v3.5/Galileo). Occasionally that happends and so I did the usual Project => Clean... as I always do in such cases. But this time I now have the odd effect that almost all files show bugs, and looking closer it's that the compiler can't find the R-file (which is indeed missing from the gen subtree).
开发者_开发问答How do I force eclipse to rebuild that file?
Michael
"W/ResourceType( 8032): Bad XML block: no root element node found" means that you have a malformed XML resource. I think the error message should indicate which file it does not like.
I was able to force a rebuild by creating an empty R.java file in my gen folder, eclipse then woke up, compiled resources, and replaced my R.java with the correct auto generated one.
I had this issue, deleting R in order to force a reacreate, however it did not because I forgot to escape an apostrophe
<string name="button_go">Let's go!</string>
to
<string name="button_go">Let\'s go!</string>
When R was deleted eclipse showed a tone of errors, making it hard to identify the culprit
I just encountered this problem, and found out it was due to the recent SDK update, which did not automatically include the new "Android SDK Build tools". After i re-launched the SDK Manager, i found the new entry and installed it. After that, it worked perfectly again.
精彩评论