android-arm/libjnidispatch.so not found error

风流意气都作罢 提交于 2019-12-12 15:18:25

问题


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:


  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)



来源:https://stackoverflow.com/questions/47800043/android-arm-libjnidispatch-so-not-found-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!