Error: Unable to open class file R.java

Croydon Dias picture Croydon Dias · Sep 26, 2010 · Viewed 38k times · Source

Did a fresh install of Eclipse, JDK and android-sdk.

I am currently receiving this error when creating a new project

[2010-09-26 16:07:56 - Test] ERROR: Unable to open class file C:\workspace\Test\gen\com\example\test\R.java: No such file or directory

What's the reason for this and how do I fix it?

Eclipse Helios 32 bit
java version "1.6.0_21"
Android sdk API 8

P.S. I'm new to Android development.

EDIT: I tried most of your solutions, but nothing worked. So I started using my friend's install of Eclipse Ganymede.

Answer

Ency picture Ency · Sep 26, 2010

I have had same issue, all what I needed to do, was create project and restart eclipse.

//Edit: Complete collapsing of "Package" tree works as well.