After checking the information, we had to solve the problem by our predecessors. As follows:
R. the Java file is automatically generated, but if you accidentally write an error in the XML file or click Run when editing the XML file (in fact, this XML file will be run at this time, an XML file with the same name is generated with the suffix xx. out. XML), or contain files other than XML files and image files, or have unrecognized images. Then, when you clear the project, you may find that the R. Java file under gen is gone. R. Java cannot be automatically created because of a file error. So what is the error? As long as there is a problem with the XML file, the system will never automatically generate this R. java file, because it will refer to the data in each XML file to generate R. java; The drawable folder contains unrecognized files or images. Although I know the cause, but the problem is a headache, if the project layout
There are dozens of XML files. What should I do at this time? Should I read the XML files one by one? Well, it's not. Clear the information in the console and then clear the project, at this time, there will be a lot of red information in the console. Refer to this to find the file accurately and report an error.