相互依赖的android项目
我想知道是否可以从另一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请注意,如果 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.
您还可以将常用功能提取到第三个项目中并引用它。这应该是一个常规的 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.