I ran into the dreaded “R cannot be resolved to a variable” error after doing a Project > Clean. I tracked the problem down to my main.XML file (wasnt the typical import.R in the java) . It was giving an error along the lines of “error parsing XML” at the end of my LinearLayout. To fix it I had to clear out all the code in my main.XML, save the changes, then retype it. That fixed the R cannot be resolved. However, my buttons are no longer visible in either the graphical layout image or while running on a device. I have an edittext at the top which is still visible, but the buttons below it no longer show up. Project > Clean doesn’t fix it, exiting and restarting Eclipse hasnt fixed it, typing in a harmless string or adding another button and saving hasnt fixed it. My gen file is there, and its showing the layout. Thoughts on where else to look?
Share
Aske B. answered the question for me with the links he provided, there was a problem in the the XML.