R.java This file is automatically generated. But sometimes when you write the wrong XML file, R.java does not automatically generate the corresponding value. This time we will be very accustomed to clean this project, this time will suddenly find that R.java unexpectedly disappeared.
At this time you must be very angry, you may be desperate to find answers online, there will be many answers to tell you right-click the project-"Android tools--> Fix project properties." Maybe you can't fix the R.java out. This time you have to think about whether some of the XML is wrong, out of the question. As long as there is a problem with the XML file, the system will never automatically generate this R.java file for you, because he will generate r.java with reference to the data in each of your XML, so it will not spawn naturally.
So when you clear the project, the error will change, and become empty package, error is the error in the SRC package, if you encounter such a mistake, and the project dozens of XML files, it must be depressed dead, and even collapsed.
But it doesn't matter. This time you clean the project, then the console will print out the wrong message tip:
For example : [2011-08-21 18:14:19-myweibo] F:\android_workplace\myweibo\res\layout\home_list.xml:6: Error:Error:No Resource found that matches the given name (at ' src ' with value ' @drawable/usericon ').
Note: Here is not necessarily your XML file error, it may be caused by your picture file, my project is due to 4 pictures, deleted the console prompt error file after the R file automatically recovered.
Loss of R files in Android