Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android ant error: invalid resource directory name: ./bin/res\crunch

Tags:

java

android

ant

I'm using ant command line to build an android project with an external library. (For some reason, I can't make it into a jar to put in libs/)

After completing all the steps of android update and reference link for the project and the lib project, the error of "invalid resource directory name: ./bin/res\crunch" pops out when running "ant release". I know it is a common error but failed to solve it after doing intensive research and trying out all the solutions, including 1) project->clean 2) delete ../bin/res/crunch. (it will re-appear and create the trouble) 3) change android version or SDK version to higher one

Any suggestion? Thanks!

like image 671
HMK Avatar asked Oct 20 '22 04:10

HMK


1 Answers

A cleaner solution is to clean before building:

ant clean
ant release

You don't really have to copy things from the 'crunch' directory to the 'res' directory, since these are generated as part of the build anyway.

It appears that the root cause of this problem is incompatibility between ADT v.22.2.1 and ANT. Related threads:

  • https://plus.google.com/+AndroidDevelopers/posts/hNZNjqKLpny
  • https://code.google.com/p/android/issues/detail?id=60496
like image 149
Hershi Avatar answered Oct 23 '22 10:10

Hershi