Search code examples
androidr.java-file

Recover the R.java file


While compiling my project, I lost my R.java file.

I recreated the new project and replaced all my .xml files, .java files, and all my images in the project, but in that project I also lost my R.java file.

What should do to solve this problem? Can I recreate my R.java file for the project?


Solution

  • The R.java file is automatically generated by the Android tools ; so, you should always be able to re-generate it.

    In this kind of case, forcing a clean and full-rebuild of the project generally helps.

    In Eclipse, try :

    • Project > Clean
    • And choose to clean your project.