Skip to content Skip to sidebar Skip to footer

Error: Unable To Fnd Class R.java No Such File Or Dir

I keep getting this when trying to start a new project ERROR: Unable to open class file C:\Users\Levi\Desktop\Android\workspace\Droid1\gen\com\androidbook\droid1\R.java: No such fi

Solution 1:

Clean works sometimes and should be tried. I also find that blowing away the gen directory and refreshing will cause it be to rebuilt. Try that as well.

However, sometimes even that doesn't work and I've been forced to remove the project from Eclipse and then re-import it. This, unfortunately, works for me every time if the above has not.

Good luck.

Solution 2:

Im also getting that error, running a Project->Clean in Eclipse helps for me.

Solution 3:

Project->Clean should certainly fix this (unless your resources won't compile for some seperate reason).

I remember that the first time I ran Eclipse (in mid 2009, can't remember if it was Galileo or Ganymede or whatever) on Windows Vista, it presented several problems that were eventually traced to Eclipse itself being in a directory whose path contained a space...

Solution 4:

Usually, the above tips (refresh, clean) work for me. But lately I had a very persistant instance of this error, which was caused by something else:

One of the layout .xml files in res/layout contained a reference to a custom view (org.company.project1.MyView). However, I had changed the package path (org.company.project2.MyView), so the reference had become invalid.

Thus, if everything fails try browsing your layout .xml files for invalid custom element definitions.

Cheers

Solution 5:

after spending hours trying to ultimatly discover the issue behind the Class Issue not being found, resolved,or directory not there issue....

sometimes yes the issue is due to a bad binary or xml... as sometime a clean will do the trick or a xml edit will solve the day.. when all else fails.... this may do it..

"create a new workspace"

go into the workspace.... and then

Switch to your old workspace... in the newly formed workspace...

this was my silver bullet. so frustrating to not have a solid answer.

using Version: Helios Service Release 2 Build id: 20110218-0911

Post a Comment for "Error: Unable To Fnd Class R.java No Such File Or Dir"