使用 Android 生成的 ant 构建文件时如何为 JAR 指定 lib 文件夹? [英] How to specify lib folder for JARs when using Android-generated ant build file?

查看:26
本文介绍了使用 Android 生成的 ant 构建文件时如何为 JAR 指定 lib 文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是由 android 生成的 ant 构建文件.我们的 Android 应用程序需要一个位于我们项目的 lib 文件夹中的 JAR 文件,因此我需要调整 ant 在构建内容时使用的类路径.

Im using an ant build file that has been generated by android. Our Android application requires a JAR file that lives inside the lib folder of our project, so I need to adjust the classpath that ant is using when it builds stuff.

当我跑步时:

ant -lib lib debug

项目构建得很好,但这应该在构建文件本身中.android 生成的构建文件引用了 android_rules.xml,所以很多这些东西都是自动化的.我想我的问题是,在使用 Android 构建规则时,这里的最佳实践是什么?

the project builds just fine, but this should really be inside the build file itself. The build file that android generates references the android_rules.xml so a lot of this stuff is automated. I guess my question, what the best practice here when working with the Android build rules ?

推荐答案

我们的 Android 应用程序需要一个 JAR位于 lib 文件夹中的文件我们的项目

Our Android application requires a JAR file that lives inside the lib folder of our project

把它放在libs/文件夹中,一切都会自动运行.我不知道您的应用程序中什么可能需要 lib/ 目录而不是 libs/.

Put it in the libs/ folder, and everything will work automatically. I do not know what in your application could possibly require the lib/ directory instead of libs/.

这篇关于使用 Android 生成的 ant 构建文件时如何为 JAR 指定 lib 文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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