如何使用 Ant 构建 Android 示例项目?build.xml 不存在 [英] How to build the Android sample projects using Ant? build.xml does not exist
问题描述
我相信我已经按照 Android SDK 中的说明进行操作,我现在正在尝试构建示例 LunarLander(随机选择一个)
I believe I've followed the instructions in the Android SDK, and I'm now trying to build the sample LunarLander (random one picked)
$ cd samples/android-11/LunarLander
$ ant debug
Buildfile: build.xml does not exist!
Build failed
我相信所有路径都设置正确.我之前在较旧的 Android SDK 版本中做过这个,我知道我没有遇到这个错误,所以我很困惑到底出了什么问题.
I believe all PATHs are setup correctly. I've done this before in an older Android SDK release and I know I didn't encounter this error, so I'm pretty confused as to what's wrong.
哦,还有一条信息——我只安装了 3.0 平台包,所以我不确定这是否是一个错误.
Oh, one more piece of info -- I have only installed the 3.0 platform package, so I'm not sure if that is an error or not.
推荐答案
需要执行这个命令:
android update project --target <your build target> --path <path to LunarLander example>
这将在示例目录中创建所需的 build.xml,然后 ant debug
命令应该可以工作.
which will create the needed build.xml within the example directory, then the ant debug
command should work.
查看此处.
*您可以使用 android list targets
来选择要用于您的项目的构建目标.
*You can use android list targets
to choose what build target to use for your project.
这篇关于如何使用 Ant 构建 Android 示例项目?build.xml 不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!