4

I've just updated the Android SDK to version 22.0 (well, more like a fresh install) and started a new project in Eclipse. I went through the project wizard and everything went fine but then I realised that it didn't generate the build files (neither BuildConfig.java nor R.java).

I searched a bit and found others with similar problems and someone pointed out that after updating a new package should be available called Android Build Tools. I had installed them as well and BuildConfig.java generated afterwards but I still don't have the R.java.

Some suggested cleaning up the project, editing manifest files and manually adding an R.java file so it would revert back to a generated one but none of these worked, though it showed a warning message in the IDE console when I edited the file but it didn't actually do anything

tshepang
  • 12,111
  • 21
  • 91
  • 136
user2398672
  • 43
  • 1
  • 4
  • Do you have dependencies to other JAR files in your project? if so, go to project references and put a "V" near them. that helped me. tell me if it worked. – Sean May 19 '13 at 10:57
  • 2
    It's one of the most common problems in ADT 22. Try [this](http://stackoverflow.com/questions/16608524/eclipse-giving-error-missing-r-java-file-after-recent-update/16608570#16608570) or [this](http://stackoverflow.com/questions/16610190/classnotfoundexception-after-adt-update/16610247#16610247). Edit: added the other solution. – Krauxe May 19 '13 at 11:01
  • @Krauxe appreciate you have added this as a comment and not as an answer – Raghunandan May 19 '13 at 11:06
  • @user2398672 if the answer in the link provided by Krauxe helps go to the link and upvote the same once you gain enough reputation – Raghunandan May 19 '13 at 11:07
  • @Raghunandan I'm a bit new to answering here and I've learned, thanks to you. :) – Krauxe May 19 '13 at 11:09
  • @Krauxe Thanks the second one did the trick :) – user2398672 May 19 '13 at 11:27
  • user2398672 give credit to Krauxe. He posted the comment first. – Raghunandan May 19 '13 at 11:28
  • I was editing just as you replied. Hope it's the right way to do it, if not pardon my incompetence – user2398672 May 19 '13 at 11:35

2 Answers2

5
  • Go to Windows->Android SDK Manager
  • Download or update Android SDK Build-tools

  • Open your project's properties

  • In the right panel, choose Java Build Path
  • In the left panel make sure that Android Private Libraries and Android Dependencies are checked.
  • Clean and rebuild your project
EyalBellisha
  • 1,874
  • 19
  • 28
0

Try to restart the your IDE and create a new project