简体   繁体   中英

android-arm/libjnidispatch.so not found error

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!

  1. Extract the com/sun/jna/linux-arm/libjnidispatch.so from the jar file
  2. 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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM