When developing Android applications in Eclipse often you will get errors asociated with the R file, like
R cannot be resolved to a variable
or
id cannot be resolved or is not a field
I am posting this question+answer to try to provide a complete and general look at the common mistakes an android beginner might encounter. If anyone thinks they can provide a better overview, or would like to add, edit or comment, feel free to do so.
There are basicaly 4 different things that could be wrong.
If any of these are the cause of your problems. Do NOT import the R file. it’s located in the same package as the root of your project.
In that case you DO need to import mypackage.R or mypackage.*. Just like you would import any other class from a different package.