Ant的具体使用这里就不详细说明了,这里记录下自己使用Ant批量打包apk的时候遇到的问题。
1. build 出现 crunch等字样的错误
<span style="color: #FF0000;">[aapt] invalid resource directory name: F:\workspace\Zlib\bin\res/crunch</span>
BUILD FAILED
D:\Android\sdk\tools\ant\build.xml:601: The following error occurred while executing this line:
D:\Android\sdk\tools\ant\build.xml:653: The following error occurred while executing this line:
D:\Android\sdk\tools\ant\build.xml:698: null returned: 1
在build.xml中增加property,忽略处理不需要的目录和文件, 可以加到AndroidSDK\tools\ant\build.xml (对android所有项目生效)
也可以添加到项目的build.xml中(这样子就只对自己的项目生效!)
<property
name="aapt.ignore.assets"
value="\x3Cdir\x3Ecrunch:!.svn:!.git:.*:\x3Cdir\x3E_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~" />
2.