我曾使用Eclipse IDE来构建APK文件。现在我想在Linux命令行中创建APK文件。但是当我输入“ant debug”时,它会出现以下错误:
我有ant 1.9.2版本和android 17版本。我有build.xml文件。
编辑:我将我的ant版本更改为1.8.0,但无论我做什么,仍然会出现“无法创建任务或类型checkenv”错误。
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版本和android 17版本。我有build.xml文件。
编辑:我将我的ant版本更改为1.8.0,但无论我做什么,仍然会出现“无法创建任务或类型checkenv”错误。
anttasks.jar
是 Android SDK 的一部分,应该位于路径$SDK/tools/lib/anttasks.jar
。看起来您的文件可能已损坏。请尝试运行以下命令:jar tf $SDK/tools/lib/anttasks.jar
(其中$SDK
是您的 Android SDK 路径)。 - janos