Android:r cannot is resolved to a varia ...

Source: Internet
Author: User

Android:r cannot is resolved to a varia ...

2012-07-27 10:58:32 uploaded by: Wangdao Download (0) view (57568) Comment (0) Recommendation (0)

Tags: Android: ...

Resource Description:

Android development process, encountered R cannot is resolved to a variable error message, as if there is no very certain wrong reason, generally speaking, I summed up a few possible solutions, I hope to try to work later ...

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
10. Restart your computer to prevent problems with your Android virtual machine

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.