For years, I've used the Ant integration for Eclipse to build my Android projects as outlined by Google on this documentation page. It's my favorite way of building release builds, because I can simply hit "Run external tool" in Eclipse to start the Ant build, and it runs in the background.
Since recently (I believe ADT 22.0 or 22.1), I've been getting the following failure:
[echo] Handling Resources... [aapt] Generating resource IDs... [aapt] invalid resource directory name: C:\path\to\project\bin\res/crunch
BUILD FAILED
C:\Android\android-sdk\tools\ant\build.xml:653: The following error occurred while executing this line:
C:\Android\android-sdk\tools\ant\build.xml:698: null returned: 1
I'm not sure what the cause of this is, since AAPT seems to generate the "crunch" directory itself. I've tried cleaning my project and disabling automatic building in Eclipse but to no avail.
I also tried executing ant release
outside of Eclipse, but this gives the same error. Executing ant clean release
doesn't work either, as it attempts to delete jars that are still in use by Eclipse. Therefore, the only solution that I've found to work at all is:
ant clean release
This is excruciating because as we know, restarting Eclipse is a royal pain. Furthermore, all affected projects need to be cleaned which makes the entire process take up to half an hour. I've opened issue #60496 on b.android.com, but haven't heard any official response.
Is there any solution to this aside from biting the bullet and switching to Android Studio?
The answer is here:
http://pissedoff-techie.blogspot.in/2014/07/android-build-fails-with-ant-on-eclipse.html