【发布时间】:2013-09-16 07:11:04
【问题描述】:
我正在使用 eclipse ide 构建 apk 文件。现在我想在 linux 的命令行中创建 apk 文件。 但是当我说 ant debug 时,它给出了以下错误:
Unable to obtain resource from anttasks.jar
java.util.zip.ZipException : error in opening zip file
Problem : failed to create task or type checkenv
Cause : The name is undefined
Action : Check the spelling
Action : Check that any custom tasks/types have been declared
Action : Check that any <presetdef>/<macrodef> declarations have taken place
我有 ant 版本 1.9.2 。和安卓版本 17。 我有 build.xml 文件。
编辑:我将我的 ant 版本更改为 1.8.0,但无论我做什么,我仍然得到那些未能创建任务或键入 checkenv 错误。
【问题讨论】:
-
ant 1.8.0 版正在与我合作
-
你能检查一下 anttasks.jar 是否可用并且可以访问吗?如果没有,您可以下载它。
-
如何下载anttasks.jar文件?
-
anttasks.jar是 Android SDK 的一部分,它应该位于路径$SDK/tools/lib/anttasks.jar。看来您的文件可能已损坏。此命令是否有效:jar tf $SDK/tools/lib/anttasks.jar(其中$SDK是您的 Android SDK 的路径) -
当给出命令 jar tf $SDK/tools/lib/anttasks.jar 时,它告诉 java.util.zip.ZipException:error in opening zip file at java.util.zip.ZipException.open (本机方法)
标签: java android eclipse ant command-line