如何将第三方类包含到Android apk中?

发布于 2024-08-26 05:19:30 字数 181 浏览 4 评论 0原文

我有几个第三方类,它们作为我可以构建应用程序的库。它们包含在添加 Java Build Path -> 的文件夹中。具有“添加类文件夹”的库(在 Eclipse 中)。到目前为止,我的应用程序编译运行良好。但生成的 .apk 仅包含我的类,因此应用程序无法运行。

我如何告诉 Eclipse 将第三方类也打包到 .apk 中?

I have a couple of third party classes which serve as a library I can build my application upon. They are contained in a folder which was added Java Build Path -> Libraries (in Eclipse) with "Add Class Folder". It works fine so far an my app compiles. But the produced .apk contains only my classes and therefore the application does not run.

How can I tell Eclipse to package the third party classes into the .apk as well?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ぶ宁プ宁ぶ 2024-09-02 05:19:30

Eclipse 会将 Android 项目类路径中的所有 3rd 方类打包到您的 apk 中。只要您使用适用于 Eclipse 的 Android SDK 插件,它就会默认执行此操作。

这是这个问题(以及许多其他问题)的重复: 如何在 Android 项目中使用外部 JAR?

Eclipse will package all 3rd party classes in your apk that are in your Android project's classpath. It does this by default, as long as you are using the Android SDK plugin for Eclipse.

This is a duplicate of this question (and many others): How can I use external JARs in an Android project?

半夏半凉 2024-09-02 05:19:30

不需要向构建路径添加任何内容。只需在项目中创建一个名为“libs”的子文件夹即可。将所有 jar 文件放入 libs 中。

Don't need to add anything to Build Path. Just create a sub-folder called "libs" in the project. Put all jar files in libs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文