In order to regenerate the R.class, you will have to try multiple techniques.
- Remove any R imports from your java source files:
import R.android
- Make sure to open the "Problems" panel by going to Window->Show view->Problems
- If you do have some errors in your xml resources, you will need to correct those errors. In my case I had to change my id attributes to include the "+" sign as follows:
android:id="@+id/grp_txt"
- Now proceed to do Project->Clean
- Finally do Project->Close, Project->Open
The "+" sign indicates a new resource id and the forces the aapt tool to create a new resource integer in the R.java class.