views:

167

answers:

2

I'm just getting started developing for Android and I'm running into a weird problem. First off, I'm running Eclipse for Java devs v3.5.2 with the Android 2.1 SDK installed.

Basically, whenever I do just about anything the "gen" (R.java, etc.) folder will just disappear from the project. I'm seen some people online say that it was still on the drive, just gone from the project listing in Eclipse, but in my case it is literally and completely gone.

The only fix I've found is that if I refresh, then try to build, it gives an error and "gen" shows up in the project view (though it's not on the disk), then delete it from within the project, then Rebuild All and it will say that it cannot find it and is recreating it.

Problem is, I have to do this every single time I want to build.

There's got to be a fix for this.

A: 

Some suggestions:

  • Uncheck Project->Build Automatically
  • Project->Properties->Builders: Make sure all Android (3) and Java (1) builders are checked (and nothing more)
  • Window->Preferences->Android->Build: Check "Automatically refresh Resources and Assets folder on build"
  • Right-click on project->Android Tools->Fix Project Settings (not sure what it actually does, but it can't hurt)
adamk
A: 

When mine get's list the easiest way is to delete the project (not the actual content on disc) and to create a new one based on the existing.

If that does not work you can erase all project files (.properties, .project, ...) and create the project from scratch using your existing source. Eclipse messes things up sometimes.

Moss