 <p>if your project R file not generated automatically then this are the possibility i mention below.</p> <ul> <li><p>If the R .* can not be generate means that you have some issue into the res/ folder. Check for errors in res/ folder.</p></li> <li><p>Invalid file name: must contain only [a-z0-9_.] all the res/* filename should be named with lowercase character, underscore and number between 0 and 9</p></li> <li><p>Go to Project and hit Clean. This should, among others, regenerate your R.java file.</p></li> <li><p>Also get rid of any import android.R.* statements and then do the clean up I mentioned.</p></li> <li><p>Check your latest updates in SDK manager if possible some remain to update.</p></li> <li><p>Also check target build was set to Android 2.1 (SDK v7) where his layout XML used Android 2.2 (SDK v8) elements (layout parameter match_parent), due to this there was no way for Eclipse to correctly generate the R.java file which caused all the problems.</p></li> </ul>