相互依赖的android项目

发布于 2024-09-02 16:26:20 字数 222 浏览 3 评论 0原文

我想知道是否可以从另一个 Android 项目引用一个 Android 项目。我有两个项目,test1 和 test2。我已在项目选项卡下的 test1 的项目属性中添加了 test2。不幸的是它不断抛出NoClassDefFoundError。另外,第二个 android 项目 (test2) 是否会作为单独的 apk 安装在手机上,还是会成为封装 android 项目 (test1) 的一部分?

非常感谢!

I was wondering if its possible to reference one android project from another android project. I have two projects, test1 and test2. I have added test2 in the project properties of test1 under the projects tab. Unfortunately it keeps throwing a NoClassDefFoundError. Also, would the second android project (test2) be installed as a separate apk on the phone or would it be part of the encapsulating android project (test1) ?

Thanks very much!

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

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

发布评论

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

评论(2

溺深海 2024-09-09 16:26:21

请注意,如果 test2 包含资源,这些资源不会自动打包到非 android 项目中,并且不会自动生成 R 文件。

我建议您查看 SDK 工具 的第 6 版(本周发布) ),他们现在支持图书馆项目。

Just be aware that if test2 contains resources, these will not automatically be packaged in a non-android project and the R file will not be auto-generated.

I suggest that you look at release 6 of the SDK tools (released this week), they now support library projects.

堇年纸鸢 2024-09-09 16:26:21

您还可以将常用功能提取到第三个项目中并引用它。这应该是一个常规的 Java 项目而不是 Android 项目。所以它会生成你可以参考的jar。

You may also extract the common functionality into the third project and reference it. This should be a regular Java project not the Android project. So it will produce jar that you can reference.

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