This is a common mistake that can come from several different sources:
- Error on one of the Xmls (even if it does not accuse);
- Do not save before Clean/Build;
- Any errors preventing automatic generation of this file;
I found a solution so far "definitive" here for the people where I work.
EDIT.: This form should be used as the last case, if none of the above has worked:
Since Eclipse naturally generates the file and something was blocking this procedure, I chose to do it manually. I went to the directory (Agenda/gen/br/com/contacts/UI) (for example), inside the project folder, created a copy of Buildconfig and edited its name for R. Then created a new project and copied the R code to the copy. Finally, in the project of the contacts agenda, I gave Save, Clean and Build All so that the settings were updated and the errors (generated by the lack of it) corrected. In this way, the new class R is adapted according to the requests of the created code.
I have not tested it in every possible way, but it has served everyone I have indicated. I do not know to what extent it is correct to carry out the procedures in this way, so I ask you to give me a feedback if it does not work.
You did
import android.R;
, Deleting this line will solve your problem.– Rafael Gabriel