Android 上下文 & OSGi 捆绑包
我实际上正在 Android 上开发 OSGi,我已经接近实现我的目标,但有一个小问题。
框架(Apache Felix)已成功运行。问题来自于想要获取应用程序上下文的捆绑包。我只是无法尝试使用它们,因为在运行时,我得到了一个漂亮的“无法找到 Android.content.Context 类”,引用自 [...]。 (然后在尝试获取 ServiceReference 时出现 NoClassDefFoundError)
我将 Android.jar 链接到 Bundle,但它似乎还不够(即使编译没问题)。 也许这是我创建捆绑包的方式错误,我只是在完成后将其导出为 .jar 。
因此,如果您有一些关于如何解决此问题的提示,欢迎提供;)
谢谢!
I'm actually working on OSGi on Android, and I'm close to reach my goal, but there's one little problem.
The framework (Apache Felix) is running successfully. The problem comes from Bundles that want to get Context of the Application. I just can't try to use them, because at runtime, I've got a beautiful "Could not find classe Android.content.Context", refrenced from [...].
(And then come a NoClassDefFoundError when trying to get the ServiceReference)
I linked the Android.jar to the Bundle, but it doesn't seems to be enough (even if compilation is ok).
Maybe it's the way I'm creating the bundle that's wrong, I juste export it as a .jar when finished.
So if you've got some tips about how to solve this problem, they're welcome ;)
Thanks !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我终于完成了。我真是个傻瓜,真的。
在 Manifest.mf 的“Import-Package”部分中,不要忘记添加
android.content
现在它可以正常工作了;)
Ok, I'm finally done with it. I am a fool, really.
In the Manifest.mf, section "Import-Package", don't forgot to add
android.content
It now works perfectly ;)