Clean in Eclipse temporarily destroys Android project with error message: missing required source folder: 'gen?

We have finally tracked the last problem regarding this bug.

We have finally tracked the last problem regarding this bug. The "clean" action used to always delete the "gen" folder which was wrong. This was fixed in ADT 8 or 9, I can't remember.

However, if the "gen" folder is marked as derived it still gets deleted which leads to the error. When the "New Project Wizard" is run, the gen folder is created normally, without the "derived" flag, so this is fine. The following scenario however is broken: delete manually gen, or check in the source code in a repository (git/svn/...) and don't put the "gen" folder in there, then do a check out on another computer.

This leads to ADT recreating automatically the "gen" folder during build, this time enabling the "derived" flag, which will trigger the wrong behavior on "clean". The temporary solution is to: right click "gen" choose "Properties" uncheck "Derived" as long as the "gen" folder doesn't get deleted you'll be able to clean your project without side effect. I just checked in a fix to: - never mark the folder as "derived" - during clean, first remove the "derived" flag from "gen" so that it doesn't get deleted in the case of older projects.

Patch is visible at: https://review.source.android. Com/#change,22410.

Good news. I'll see if I can dig out the project and test. I think the reason I had the problem was because I checked out the source code from a repository in which gen wasn't put.

Thanks for not giving up! – darius Apr 20 at 11:24.

I had the same problem, and there is how I solve it: Disable "Build Automatically" Clean the project Create the "gen" folder manually by "New -> Folder" Re-enable "Build Automatically" as need.

Darius This worked for me... Thank you WanCW... – Fresh_Meat Apr 15 at 4:36.

It is not a showstopper but it is so painful and annoying if you have several people working on the same project and you cannot check in the IDE settings into source depot, and you have Ant build script and IDE based build system setup for whatever reason. It is not a showstopper since you can manually do this do that every other time, but this is just (a) workaround(s). It is painful as many of us have to carefully check logcat/console/navigator/project_setting to make sure there is no other "real" problem present each time it occurs.

I suspect the root cause is the timing issue to validate the "gen" existence, the second is the revalidate the "build path error" condition. The "gen" folder, no matter is marked as derived or not, can be recreated; once it exists, the "build path error" condition should be updated. The second suspection is there is a dead lock for these two condition flags somehow.

Hope you can dig into this issue and fix it eveually.

AFAIK, If Everything is Perfect you have know need to touch or delete the gen Folder. As soon as I edit some code the problem disappears until I perform a clean again. What are the things you have changed in your code.

Mainly about the Resources. It makes the difference upto my knowledge. Don't see only the Logcat and Consider the Console window also shows some error in the red color.

First clear that errors and then clean and build your project. Edit: Check for: Is there Android Package is Missing? Right Click--> Properties--> Java Build Path--> Order and Suppport Tab--> Check res or src folders are selected?

Thanks. Logcat-tab in Eclipse shows nothing (since the app is not running). The console-tab shows nothing when I perform a clean.

The Problems-tab is showing error message I wrote above. When I edit any code (like adding a meaningless space-char) and save it Eclipse "does something" and the error message disappears. – darius Sep 29 '10 at 11:14 @darius: It may some chances that for Missing Android Package.Do you have such thing in your project folder on Eclipse.

– Praveen Sep 29 '10 at 11:18 Thanks again. 1)I can't see any mention of Android Package Missing.2)I compared with a working Android project and it looks the same.(The checkboxes are brown without an actual "check" in both projects. I can't seem to activate a "check".

) – darius Sep 29 '10 at 11:52 @darius: goto Properties--> Android--> Select a Project Build Target Again. And also mention the in the Manifest too. – Praveen Sep 29 '10 at 12:13 Project Build Target is set to Google APIs, Platform 1.6, API Level 4.

The Manifest has the tag at the end, just before the manifest closing tag. – darius Sep 29 '10 at 12:46.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions