0

I was doing some work on my app when I accidentally deleted the file R.java in the gen folder. Is there any way to get it back? I need it because it is giving ever activity errors. I tried copying my data into another application and that didn't work. I also checked my recycle bin and there was no file and cleaned. Please help?

CodingN00B
  • 43
  • 1
  • 7
  • possible duplicate of [Developing for Android in Eclipse: R.java not generating](http://stackoverflow.com/questions/2757107/developing-for-android-in-eclipse-r-java-not-generating) – Nick Sep 02 '13 at 03:05
  • Usually the `R.java` is auto generated when you delete it, make sure the `xml` file has no error – Sieryuu Sep 02 '13 at 03:05
  • 1
    Clean Project. Rebuild Project. Pray. – JustinDanielson Sep 02 '13 at 03:08

3 Answers3

3

Several ways to get out:

  1. Simply modify(add a white space or so) in one of your resource files and save it, if the eclipse is enabled 'build automatically', the R.java will be re-generated again.
  2. Go to project - clean project, clean your project and it will be re-generated when you run the project again
Robin
  • 10,052
  • 6
  • 31
  • 52
  • Please check if there is any error in your resource files. Are you using eclipse or any other IDE? Or just native command line build? – Robin Sep 02 '13 at 03:23
1

It is automatically generated file

Just clean and rebuild you project If there is no error{there must not any xml error which neither shown error nor let R.java build} then it will create your R.java file

again

Every Successful build just re-create new R.java file

Community
  • 1
  • 1
Trikaldarshiii
  • 11,174
  • 16
  • 67
  • 95
0

R.java is auto generated when you delete it, make sure the xml file has no error . If this is also not solving your problem the start doing your project from scratch no copy paste.

Shakeeb Ayaz
  • 6,200
  • 6
  • 45
  • 64