使用 Ant 构建 Android 库项目 [英] Build Android Library Project With Ant

查看:35
本文介绍了使用 Ant 构建 Android 库项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 ant 构建我的 Android 库项目时遇到问题.当我尝试运行 ant release 时,它说 Target release" 在项目MyProject" 中不存在.

I am having trouble building my Android library project with ant. When I try to run ant release, it says Target "release" does not exist in the project "MyProject".

然后我假设库可能没有通过发布/调试来构建,所以我开始使用 ant compile,这似乎有效.然后我使用 java 的 zip 实用程序手动压缩文件夹并将其重命名为 .apk.我猜这是错误的做法.

I then assumed that perhaps libraries do not get build with release/debug, so I started using ant compile, which seems to work. I then zip the folder manually using java's zip utility and rename it to .apk. I am guessing this is the wrong way to do this.

谁能告诉我如何使用 ant 构建一个 Android 库项目?

Can anyone show me how to build an Android library project using ant?

推荐答案

然后我假设库可能不会通过发布/调试来构建

I then assumed that perhaps libraries do not get build with release/debug

正确.

我猜这是错误的做法.

也正确.

谁能告诉我如何使用 ant 构建一个 Android 库项目?

Can anyone show me how to build an Android library project using ant?

您通常不会构建 Android 库项目.您构建引用 Android 库项目的其他项目.创建引用库项目以与 Ant 一起使用的项目在 Android 文档.有关 Android 库项目作用的更多信息,也可以在 Android 文档中找到.

You typically do not build an Android library project. You build other projects that reference the Android library project. Creating projects that reference the library project, for use with Ant, is covered in the Android documentation. More information about the role of Android library projects can also be found in the Android documentation.

这篇关于使用 Ant 构建 Android 库项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆