Reputation: 137382
I have a shared object file which I call from my android app. Until now I had it in my java project, and I loaded it like that:
static { System.loadLibrary("mysofile") };
Now I'm trying to load it from other location:
static {System.loadLibrary("/mnt/sdcard/mysofile.so"}
But I get the following error:
03-13 14:26:12.183: ERROR/AndroidRuntime(2339): java.lang.UnsatisfiedLinkError: Cannot load library: load_segments[928]: 92 failed to map segment from 'mysofile.so' @ 0x83400000 (0x00001488). p_vaddr=0x00000000 p_offset=0x00000000
Could someone help me solve it?
Thanks, Binyamin
Upvotes: 0
Views: 673
Reputation: 1007296
What you want most likely is not supported. Please use the NDK and follow its instructions for properly supporting JNI on Android.
Also, never hard-code /mnt/sdcard
, as that is wrong on most Android devices. Use Environment.getExternalStorageDirectory()
to identify the root of external storage.
Upvotes: 1