How to troubleshoot Android Project R file loss

Source: Internet
Author: User

There are many reasons why R files are missing, here are a few workarounds:

1. Select the item, click Project-clean, and clear the project.

2. Select the project and right-click on Android tools-fix Project Properties;

3. Select the item, right-select Properties-android, select the corresponding version number, click OK;

So the R file will be generated again.

Some articles say that the first two steps of the R file can be generated again. But sometimes I do the first two steps R file. Or not, try the last step. I am here to build a success!


Let's say it doesn't work. This time you need to think about whether some XML is wrong. Out of the question. Just to have a problem with the XML file, the system will never give you the initiative to generate this R.java file. Because he's going to take the data from every single one of your XML to generate R.java. So the nature will not be able to generate.

So when you clear the project, the error changes and turns into an empty bag. Errors are also errors in the SRC package, if you encounter this error, and the project has dozens of XML files. That must be depressing to death, even collapsed.

It just doesn't matter. This time you re-clean the project. At this point the console will print an error message:

For example : [2015-05-21 18:14:19-myweibo] F:\workplace\myweibo\res\layout\home_list.xml:6: error:Error:No resource found That matches the given name (at ' src ' with value ' @drawable/usericon ').


Let's say, friends, they have other problems. Welcome to discuss http://blog.csdn.net/ycwol/article/details/44242867

How to troubleshoot Android Project R file loss

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.