I've found out that my R.java is never updated, so it doesn't contain information about my new resources, so I decided to delete it and thought that Eclipse would generate a new one. But that didn't happen, and I don't have R.java now. How can I regenerate one?
I'm using Windows 7.
From one of the comments: "Doing Project -> Clean is what caused the problem for me. Cleaning deletes R.java...and for whatever reason the plugin is not regenerating the file."
This site suggests:
if you run a clean on the project it should regenerate all the generated Java files, namely R.
In Eclipse, under the Project menu, is an option build automatically. That would help you build the R.java file everytime modifications are made. The Clean... option is also there under Project.
This site suggests another solution.
I found this happening to me with a broken layout and everything blows up. Relax, it's like that old mistake when you first learned programming C where you forget one semicolon and it generates a hundred errors. Many panic, press all the buttons, and makes things worse.
R.links to is not broken. Fix all errors in your XML files. If anything in the ADKs are broken,
Rwill not regenerate.
import android.Rin your activity, remove it.
Menu -> Project -> Build Project.
This usually happens when you have a broken XML file.
/values/, especially if you've changed one of them recently
AndroidManifest.xml. I find that often I change a string and forget to change the string name from
Android SDK Build-toolsis installed. Window -> Android SDK Manager -> Tools -> Android SDK Build-tools
Android SDK Tools, you also update the
Android SDK Platform-toolsand
Android ADK Build-tools. Build fails silently if they don't match.