5

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.

3
  • Have you updated the Android SDK tool recently ? Commented May 27, 2013 at 13:23
  • Yes I did an update but this behaviour is the first time it happens. All my past updates didn't cause this strange behaviour, that's why I didn't remember to check SDK Tools Commented May 27, 2013 at 13:35
  • Possible duplicates: stackoverflow.com/search?q=%2Beclipse+%2Br.java+%2B+generate Commented May 27, 2013 at 13:48

2 Answers 2

16

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.

Sign up to request clarification or add additional context in comments.

5 Comments

Had the exact same problem today.. Updated Android SDK and Eclipse and the Build Tools disappered.
After this update my Eclipse went nuts. Projects that were working just fine now throw Dex Loader, Dalvik and java.lang.NoClassDefFoundError errors. Nice Google, going to reinstall ADT and all this crap again...
You have to import the SupportLibrary for any project with these errors.
Well remembered I had forgotten to update the android-support-v4.jar, but the "Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/google/common/base/Function;" is still here
Installed Android ADT Bundle (Eclipse) everything is working now
3

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.

2 Comments

All my files were ok, build-tools went missing without reason :/
Something similar here, had an error in one of my menu.xml files, but eclipse didn't bother to flag it as error

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.