Issue
In my app, I am adding third party hardware connectivity and using their provided code for java. Also using jna.jar
to interact with that code as it uses native library to load some .so
files. It throws the error:
java.lang.UnsatisfiedLinkError: Native library (com/sun/jna/android-arm/libjnidispatch.so) not found in resource path (.) Please help where can I get the jar with android-arm/libjnidispatch.so in it.`
I tried adding android-arm.jar which is having libjnidispatch.so separately but compiler is looking for jna.jar's path. Thanks!
Solution
- Extract the com/sun/jna/linux-arm/libjnidispatch.so from the jar file
- put the .so file in the following directory (when using android studio): yourproject\app\src\main\jniLibs\armeabi-v7a\libjnidispatch.so
And also please note that linux architecture != android architecture (google uses a different c library (bionic), which is a different one than the normal linux distributions) For all architectures see:
https://github.com/java-native-access/jna/tree/master/lib/native
Which version of JNA do you use? (There was a bug in JNA 4.2.2/4.3.0 which might also be a cause)
Answered By - Lonzak
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.