14

This happens for a new project too!

The gen folder is empty. No errors in activity_main.xml file.

I have tried:

  • Project->Clean
  • Project->Properties-> check android version
  • Project->Build
  • Re installing eclipse (latest)
  • Re installing ADT plugin (latest)
  • commenting lines: setContentView(R.layout.activity_main); and getMenuInflater().inflate(R.menu.main, menu); and building project

but still the gen folder is empty! help!

Frozen Crayon
  • 5,172
  • 8
  • 36
  • 71

4 Answers4

21

This solved my problem: Eclipse giving error, missing R.java file after recent update

It was the latest ADT update. After the update we need to install android sdk build-tools.

Community
  • 1
  • 1
Frozen Crayon
  • 5,172
  • 8
  • 36
  • 71
4

I assume you have updated ADT with version 22 and R.java file is not getting generated.

If this is the case, then here is the solution:

Hope you know Android studio has gradle building tool. Same as in eclipse they have given new component in the Tools folder called Android SDK Build-tools that needs to be installed. Open the Android SDK Manager, select the newly added build tools, install it, restart the SDK Manager after the update. Got this answer from this link. Eclipse error: R cannot be resolved to a variable

It's working for me now

Community
  • 1
  • 1
stickypens
  • 103
  • 4
2

The solution is to restart the SDK Manager after updating the SDK tools to version 22. Only then the newest version of the Android build tools appears and can be installed. This fixed the error for me.

Display name
  • 2,697
  • 2
  • 31
  • 49
1

I had the same problem.

I solved it this way:

  • In the project properties (eclipse) -> java build path -> order and export make sure that all your jars in the libs folder are checked.
  • And "Android Tools -> Fix Project Properties" then "Project -> Clean"
  • Be careful not to forget to put in: "Project -> Build Automatically"

This is a problem with the updates of Android SDK (tools version 22, platform tools version 17).

lopez.mikhael
  • 9,943
  • 19
  • 67
  • 110