android--processing R file missing or error problem

Source: Internet
Author: User



In Android development, the R class is an automatically generated class that is placed in the Gen directory and is responsible for managing resources in the application. R file error is a very common problem, below to summarize why it is error and how to deal with errors.


First say why the error:


Just said, this class is responsible for managing resources, so it is in addition to the error, first you have to check whether your resource files are correct, that is, your res folder of things. There are many causes of resource file error, often encountered such as, the layout file name capital, copy when the same ID generated the view ... After you have ruled out these issues, try the following steps in turn if you are not OK:


1. Re-check the validity of XML in the resource file

Although the above analysis of the reasons for the time said once, but the important thing is to say more, again, remember to beat themselves.

if the last compile time is not generatedR.javafile, the project resource reference error is raised. Typically, this is by layoutXMLcaused by a spelling error in the file. Because the layout cannot be verifiedXMLthe validity of the document,Eclipseinput error alerts are often not available. Fix bugs and saveXMLfiles,Eclipsewill regenerate the newR.javafile.


2, Cleanup project

Select the project--clean menu item. Eclipse will recompile the entire project, eliminating errors.


3, run Android Lint

Select Window---Run Android Lint menu item. Lint will check and comb the project resource files.


4. Delete Gen Directory

ifEclipseunable to generate a newRfile, we can delete the entireGendirectory. Eclipsewill recompile the project and create a newGenfile with full-featuredRfile.









Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

android--processing R file missing or error problem

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.