android ant error: invalid resource directory name

2019-05-01 04:07发布

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!

标签: java android ant
2条回答
地球回转人心会变
2楼-- · 2019-05-01 04:43

Finally I figured it out: copied everything from bin/res/crunch folder and pasted it in res and then deleted the crunch folder. If the library project is modified, the error will reappear. Redoing the procedure above will fix it again.

查看更多
Rolldiameter
3楼-- · 2019-05-01 04:46

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:

查看更多
登录 后发表回答