Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse doesn't generate R.java and gen folder [duplicate]

I had to share this problem with you 'cause I lost an entirely morning around this. So what was my problem? Suddenly Eclipse refuses to generate R.java and create gen folder. I've tried all kind of solutions I came across in stackoverflow and some blogs:

  • Clean Project and Rebuild
  • Clean Project with Build Automatically off and then Rebuild
  • Create the gen folder
  • Create gen folder with a R.java dummy
  • Copy the gen folder from that project used in another project (different workspaces)
  • Validate all my .xml files

Nothing worked... So, what was the solution? I'll answer myself.

like image 470
GuilhE Avatar asked May 27 '13 13:05

GuilhE


2 Answers

Checking the SDK Manager worked for me. It seems Android Build Tools went missing :/
Strange behaviour from eclipse...

enter image description here

After installing it everything worked as expected. So here's another solution...

Hope it works for you,
Take care.

like image 193
GuilhE Avatar answered Nov 01 '22 09:11

GuilhE


I spent on this about an hour... In my case it was because of a file in drawables containing -.

Eclipse can't mark your files with wrong characters.

check your drawable folders and files in them. Also you can check another folders with resources or something like that. This problem can be caused by wrong (unsupported) characters in some file names.

like image 36
shift66 Avatar answered Nov 01 '22 08:11

shift66