Android R file not generating

Ryan Sayles picture Ryan Sayles · May 24, 2013 · Viewed 19.7k times · Source

I know there are a lot of threads about this but I couldn't find one that solved my problem or is a duplicate.

So I was working on an app, accidently made the mistake of cleaning my project. This caused my R.java file to disappear. I tried cleaning my project again, building it again, closing eclipse, deleting the gen folder, checking all of my xml files for errors, all of that.

Problem now is whenever I create a new completely blank application project that doesn't even generate an R file automatically. I'm hoping there is still a way to restore it for my original project but as I stated nothing seems to work.

Answer

Andrew picture Andrew · Feb 7, 2014

It could be if you have deleted

  <string name="action_settings">Settings</string>

in the strings.xml, but not deleted main.xml file in the menu folder.