Android r file lost build failed

Source: Internet
Author: User

Android development process, encountered R cannot is resolved to a variable error message, from the Internet searched a bunch, found no matter use as follows: Finally resolved, here to make a record, online summary of the following:

1. Check if the Android SDK is missing and need to download again, check the build path

2. Ensure class does not have import ANDROID.R;

3, error class refers to the layout of the XML file without errors

4. Check the Androidmanifest.xml file, inside the package,layout configuration file, Strings.xml and other strings are all written correctly

The string in the Strings.xml referenced in the 5.layout XML file is spelled exactly correctly

6. In the layout of the XML file to add a control handwriting to see if the ID can be automatically generated in R.java, if not, it is very likely that the layout of the XML file is a problem, to see whether the format is used correctly, or contain any illegal string, or call to an incorrect string, And so on, you can use the exclusion method to remove the control, until you find that the error message disappears or the ID can be automatically generated in R.java.
7. Delete the Gen folder, make the R.java auto-generated once, if not, continue to check the layout of the XML file is not easy to find the problem

8.Clean project, re-build, or re-import project.

9. Restart Eclipse

My mistake appears and the above is not the same, the following post my question:

My reason for the error is this, I downloaded a few PNG images from the Internet, directly into the resource file, the beginning of the time has not been a problem, I hand a cheap click on the project clean, Then R.java file is lost, in accordance with the above problems collected by netizens, I checked once and again, found not the above reasons, and finally see the error output, found that the problem lies:

This is the file name that you put in the resource file does not conform to the specification:

Standardize the name, OK!!

Android r file lost build failed

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.