Quentin
Quentin

Reputation: 21

Android context & OSGi Bundle

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 !

Upvotes: 1

Views: 875

Answers (1)

Quentin
Quentin

Reputation: 21

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 ;)

Upvotes: 1

Related Questions