Loss of R files in Android

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.