java.lang.UnsatisfiedLinkError: dlopen failed: library "XXX.so" not found
来源:互联网 发布:windows的uac 编辑:程序博客网 时间:2024/05/16 09:17
厂家提供.so文件,我自己再写一份.cpp 文件去调用 厂家提供的.so 文件中的方法,并生成自己的.so 文件。编译没有问题,但是运行时报上面的错误。我自己生成的那份.so 文件没有说not found ,但是厂家提供的.so 文件说not found .
首先我根据他not found 提供的地址,发现地址下 这个.so文件是存在的.所以进而向厂家提供咨询.
厂家可能没有用Android studio 进行过开发,但是他向我确认两个方面.
1. 首先,确定下我们的编译环境是一样的吧 我的编译是 /opt/arm-linux-androideabi-4.8/bin/arm-linux-androideabi-g++
2. 其次,确定你的运行环境,有libtivhs_sdk.so(就是我发给你的) 确保运行程序的时候可以找到库的.
第二点我已经确认过,下一步我寻找Android studio 是什么编译环境.
在AS官网找到了NDK的工具链说明 :NDK独立工具链
Android studio 默认情况下,构建系统使用 32 位、基于 ARM 的 GCC 4.8 工具链: arm-linux-androideabi-4.8
指定工具链为arm-linux-androideabi NDK toolchain对应ABI
其实不指定AS默认的就是arm-linux-androideabi,这里只是向厂家提供一个证明,证明我确实用了这个工具链.
#Android.mk
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := armeabi armeabi-v7a
APP_PLATFORM := android-22
NDK_TOOLCHAIN := arm-linux-androideabi-4.8
但是居然ndk build报错说这个工具链不能支持编译arm : what?!肿么可能不支持
Android NDK: The selected toolchain (arm-linux-androideabi-4.8) does not support the armeabi ABI.
Android NDK: Please modify the APP_ABI definition in D:/android/android-project/KedaSmartCamera/app/src/main/jni/Application.mk to use
Android NDK: a set of the following values:
Android NDK: Or change your NDK_TOOLCHAIN definition.
一脸懵逼,今天,进入到ndk-bundle\toolchains
目录下,一看,版本号写错了。
修改Android.mk 文件
NDK_TOOLCHAIN := arm-linux-androideabi-4.9,OK了
然而我的报错问题还是没解决,联系厂家沟通发现是厂家提供的两个.so库文件依赖关系没有做好..程序使用厂家修改好的.so文件运行,没有再报错了.
AS官网提供的利用独立工具链
NDK 提供 make-standalone-toolchain.sh shell 脚本以允许您从命令行执行定制的工具链安装。 与简单方法中所述的程序相比,此方法为您提供更多灵活性。
脚本位于$NDK/build/tools/
目录中,其中$NDK
是 NDK 的安装根目录。 下面展示了使用此脚本的示例:
$NDK/build/tools/make-standalone-toolchain.sh \
–arch=arm –platform=android-21 –install-dir=/tmp/my-android-toolchain
windows 下执行脚本:
安装Bash
卸载Bash
bash 进入到$NDK/build/tools/
目录中
执行
./ toolchain.sh
–arch=arm –platform=android-21 –install-dir=/tmp/my-android-toolchain
- java.lang.UnsatisfiedLinkError: dlopen failed: library "XXX.so" not found
- java.lang.UnsatisfiedLinkError: dlopen failed: library "libsqlite.so" not found
- java.lang.UnsatisfiedLinkError,dlopen failed: library \"libsqlite.so\" not found
- UnsatisfiedLinkError: dlopen failed: library “libutils.so” not found
- dlopen failed: library "libsqlite.so" not found
- java.lang.UnsatisfiedLinkError: dlopen failed: library "/system/lib64/libweibosdkcore.so" needed or
- 融云、环信dlopen failed: library "libsqlite.so" not found
- 融云、环信dlopen failed: library "libsqlite.so" not found
- 使用JNI时,出现了一个错误:java.lang.UnsatisfiedLinkError : dlopen failed: library //dlopen打开失败
- 集成环信运行提示UnsatisfiedLinkError: dlopen failed: could not load library "libhyphenate_av.so" needed by "
- JNI异常: java.lang.UnsatisfiedLinkError: dlopen failed: ***.so: has text relocations
- java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.gkzxhn.prision-2/lib/arm/libosp.so: has
- 报错java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/cn.*****/lib/arm64/libGlobal.so" is 3
- java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.smallvideo-1/lib/arm/libutility.so: has
- 找不到dlopen failed: library "/data/data/com.example.gpstest1/lib/libgnustl_shared.so" not found
- java.lang.UnsatisfiedLinkError: dlopen failed:has text relocations
- java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/**********/lib/arm/libapp_BaiduPanoramaApp
- java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__aeabi_memcpy"
- Android实现点击通知栏后,先启动应用再打开目标Activity 144
- OC runtime知识
- twosum(new edition)
- 虚函数实现原理
- 自记linux命令
- java.lang.UnsatisfiedLinkError: dlopen failed: library "XXX.so" not found
- 续上面
- 我们做App的一定要用这种友好的方式去跟用户交互
- opencv 中常用的数据类型
- 快学numpy01
- 封装自己的jq插件
- [leetcode]141. Linked List Cycle@Java解题报告
- 更新linux系统内核后分辨率问题解决
- 【HTCVR】VRTK基本功能脚本说明