0

Every time I try to add a button, add an image view, edit a button, pretty much do anything, my R.java disappears and the only way I can fix the problem is by starting again

I have read evey single post on this and tried every single suggestion but nothing seems to work. Can someone please help me as this is insane?. I'm sure there must be something I need to change as I'm pretty sure this can't be happening to all android developers every 10 minutes.

Blackbelt
  • 156,034
  • 29
  • 297
  • 305
  • mabey u have errors in your layout, in this case eclipse can't create R – anfy2002us May 30 '13 at 15:20
  • Probably there are errors in your Android activity files so when automatically compiling the project it can't generate the R file. For me, the best is to remove the Automatic Build option and rebuild the project manually whenever I want. In this way, if the R file is not generated, then I must check for errors in the project and then just recompile one more time. – Luiggi Mendoza May 30 '13 at 15:21
  • 1
    This should help. http://stackoverflow.com/questions/12825004/error-androidmanifest-xml-file-missing-what-am-i-missing/12825105#12825105 – Susie May 30 '13 at 15:39
  • after adding anything are you saving(ctrl+S) that thing? – karan May 30 '13 at 22:44
  • if xml is not saved it would miss the unsaved resources – karan May 30 '13 at 22:45

2 Answers2

2

For me the best trick is to clean the project:

At Eclipse: Project -> Clean -> Select project and than OK.

Birdy
  • 355
  • 1
  • 5
  • 15
0

Are you using your build over "Build automatically" ? Any changes of your code, after autosave your project is build again and the R-File is generated.

Luser_k
  • 514
  • 1
  • 4
  • 18