mercoledì 22 gennaio 2014

Error while building Android project with Ant

The ADT (Android Developer Tools) version 22 contains a bug while building an Android project with Ant.

[aapt] invalid resource directory name: <your-project path>/bin/res/crunch

The cause is the compatibility between the Eclipse Android Plug-in and the Ant script: the first generates the crunch-ed image files ignored by the second!

A simple workaround is to remove the crunch directory (generated by the Eclipse plugin) before to build:

find . -name crunch -exec rm -Rf {} + ; ant