android-arm/libjnidispatch.so未找到错误 [英] android-arm/libjnidispatch.so not found error

查看:512
本文介绍了android-arm/libjnidispatch.so未找到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我添加了第三方硬件连接,并将它们提供的代码用于Java.还使用jna.jar与该代码进行交互,因为它使用本机库加载某些.so文件.它引发错误:

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.`

我尝试添加分别具有libjnidispatch.so的android-arm.jar,但编译器正在寻找jna.jar的路径.谢谢!

I tried adding android-arm.jar which is having libjnidispatch.so separately but compiler is looking for jna.jar's path. Thanks!

推荐答案

  1. 从jar文件中提取com/sun/jna/linux-arm/libjnidispatch.so
  2. 将.so文件放在以下目录中(使用android studio时):yourproject \ app \ src \ main \ jniLibs \ armeabi-v7a \ libjnidispatch.so

还请注意linux体系结构!= android体系结构(Google使用了不同的C库(仿生),与正常的Linux发行版不同) 对于所有体系结构,请参见:

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

您使用哪个版本的JNA? (JNA 4.2.2 /4.3.0中存在一个错误这也可能是一个原因)

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)

这篇关于android-arm/libjnidispatch.so未找到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆