5 solutions to the disappearance of r files during Android development

Source: Internet
Author: User

Android automatically generates a R.java file in development, which is automatically generated and is best not to be changed. But sometimes, this Java file will play Hide-and-seek with us, the r.xx.xxx in the program will appear error.

1. right mouse click on the project to choose Build Project, R.java file back again. Such r.xx.xxx can be read out.

If not, try the second method.


2. Choose eclipse/myeclipse 's clean so R file will also appear.

If it's not, try the third kind.


3. through the above two methods do not use the trick from other projects to copy a copy of the R.java file and then String.xml in a casual change can update r file

If you still can't, try the fourth kind.


4. after the above 3 methods are not enough to explain our project has a good check it

For example resource resources in the file naming, example Result.xml, if written result_main.xml is wrong to need all lowercase


5. If the above four options are not feasible, I also encountered a similar problem in the development, but the above scheme did not give me the right hint, I was so resolved:

First check to see if the SDK is up to date, so I turned on the Android SDK Manage in Eclipse, and I found out that I had to update all the packages that needed to be updated, and then turn off the Android SDK after the update. Manager and then reopen it to find that the manager will perform a series of refresh actions, and all status becomes installed, which indicates that the SDK is up to date and that the R file is already under the Gen directory.

Related Article

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.