Check the xml files of your layout, whether they are saved correctly without errors or not.
I ran into a similar problem that suddenly R.java disappeared and the eclipse could not restore it after creating the SDK. I checked the SDK manager and saw that the Android SDK build tool was perfectly installed. Finally, I noticed that there are some errors in the xml files. After fixing and saving those, R.java is automatically generated in my case.
source share