Finally, we traced the last problem associated with this error.
A "clean" action used to always delete the "gen" folder, which was incorrect. This was fixed in 8 or 9 ADT, I do not remember.
However, if the "gen" folder is marked as a derivative, it is still deleted, which leads to an error.
When the "New Project Wizard" starts, the gen folder is created normally, without the "derived" flag, so this is normal.
The following scenario is broken:
- manually remove gen or
check the source code in the repository (git / svn / ...) and donโt put the โgenโ folder there, and then check on another computer.
This causes ADT to automatically recreate the gen folder during build, this time turning on the derived flag, which will result in incorrect clean behavior.
Temporary solution:
- right click "gen"
- select "Properties"
- uncheck the box Derivatives
until the gen folder is deleted, you can clear your project without a side effect.
I just checked in the fix: - never mark the folder as "derivative" - โโduring cleaning, first remove the "derivative" flag from "gen" so that it is not deleted in case of old projects. The patch is displayed at: https://review.source.android.com/#change,22410
source share