Met R cannot is resolved to a variable problem, turned over the online information, conditioning the collation of a bit
1. Check if the Android SDK is missing and need to download again, check the build path, import the jar package confirmation to the successful
2. Ensure that class does not have import ANDROID.R, note that there is no ANDROID.R, there can be other R files, such as your own package;
3. Error class refers to the layout of the XML file is not an error, often there is an error in the XML, causing the R file does not build properly
Most of the time this place is wrong, you can try to add a control in the layout of the XML file, to see if the ID can be automatically generated in the R.java, if not, it is very likely that the layout of the XML file has a problem, to see whether the format is used correctly, or contain what 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. Remember that often because of the Android word misspelled and the R file does not generate normally and always r cannot be resolved to a variable
4. Check the Androidmanifest.xml file, inside the package,layout configuration file, Strings.xml and other strings are all written correctly.
5. 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
6.Clean project, re-build, or re-import project.
7. Restart Eclipse
8. Restart your computer to prevent problems with your Android virtual machine
This article is from the "Android IOS" blog, so be sure to keep this source http://lovely1133.blog.51cto.com/1612511/1694278
Android R cannot is resolved to a variable