如何创建在命令行apk文件? [英] How to create apk file in command line?
问题描述
我使用的Eclipse IDE构建apk文件。现在我想建立在Linux命令行apk文件。 但是,当我说蚂蚁调试它提供了以下错误:
I was using eclipse ide to build apk file . Now i want to create apk file in command line in linux. But when i say ant debug it gives following error :
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
我有蚂蚁的版本1.9.2。和android版本17。 我有build.xml文件。
I have ant version 1.9.2 . and android version 17. I have build.xml file .
编辑:我改变了我的蚂蚁版本为1.8.0,但无论我做什么还是我得到那些未能创建任务或键入checkenv错误。
Edit : I changed my ant version into 1.8.0 , But whatever i do still i am getting those failed to create task or type checkenv error .
推荐答案
请确保您有一个名为 local.properties
在根目录下的文件(即同一目录你的的build.xml
)。
Be sure that you have a file named local.properties
in the root directory (i.e. same directory as your build.xml
).
请确保该文件包含这样一行:
Be sure that this file contains a line like this:
sdk.dir=c:\\tools\\android-sdk
(当然,你需要适应的路径有效的SDK的位置)
(Of course you need to adapt the path to your effective sdk location)
仔细检查的路径是正确的。
Double-check that the path is correct.
重办蚂蚁调试
注:文件local.properties是本地的(!并且通常不在版本控制之下)
Note : the file local.properties is local (and is usually not under version control !)
这篇关于如何创建在命令行apk文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!