wyr0
wyr0

Reputation: 133

OSGI Bundle-NativeCode give error "No match found for native code"

I'm developing an OSGI bundle which uses the native library librxtxSerial. The first time, I had to deploy this bundle on a raspberry, so I've did something like that:

I put the native library under: lib/librxtxSerial.so (NB: INSIDE the java project).

Then, in the MANIFEST I've wrote:

Bundle-NativeCode: lib/librxtxSerial.so

Everything works fine!!!

Now, the problem is that I've to deploy the same bundle on other embedded device which uses a different processor architecture (x86 instead ARM).

So, I've downloaded the x86 build for the librxtxSerial library and I modified my folder structure in something like that:

 - lib
   - x86
     - librxtxSerial.so
   - arm
     - librxtxSerial.so

And I've modified my MANIFEST in this way:

Bundle-NativeCode: lib/x86/librxtxSerial;processor=x86, lib/arm/librxtxSerial;processor=ARM_le

Trying to compile (through maven tycho plugin) I always get the same error:

No match found for native code: lib/x86/librxtxSerial; processor=x86, lib/arm/librxtxSerial; processor=ARM_le

How can I solve this?

Upvotes: 2

Views: 1550

Answers (1)

wyr0
wyr0

Reputation: 133

Ok, i've solved. Not sure why but in order to solve this issue is enough to add '*' at the end of the header, so:

Bundle-NativeCode: lib/x86/librxtxSerial;processor=x86, lib/arm/librxtxSerial;processor=ARM_le, *

it now works.

Upvotes: 2

Related Questions