No generated R.java file in my project [duplicate] No generated R.java file in my project [duplicate] android android

No generated R.java file in my project [duplicate]


Go to Project and hit Clean. This should, among others, regenerate your R.java file.

Also get rid of any import android.R.* statements and then do the clean up I mentioned.

Apparently Jonas problem was related to incorrect target build settings. His 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.


After one whole day trying to find why R file was not generated, I found that after install Android SDK Tools r22 a new option in Tools was available: Android SDK Build Tools.

After installing it R file was generated again.


now you have imported android.R instead of your own R... Try to take a look on your "problems" view if you have errors in one of your xml files... get rid of the import android.R and comment out all usages of R.*

Cleaning should help when your project has no other errors, so check your xml files or file naming in your res folders