could not load library quot;libdl.so.2quot;(无法加载库“libdl.so.2)
问题描述
I have been trying to use linux compiled prebuilt shared library with my android jni application, but when i try to run the application it gives following error:
04-16 19:09:13.633: E/dalvikvm(11810): dlopen("/data/app-lib/com.lXXXX.XXXX.connect-2/libXXX_embedded_shared.so") failed: Cannot load library: soinfo_link_image(linker.cpp:1636): could not load library "libdl.so.2" needed by "libXXX_embedded_shared.so"; caused by load_library(linker.cpp:746): library "libdl.so.2" not found
i could not find libdl.so.2 in android/system/lib but there is a library libdl.so which i tried to load but it still did not resolve the dependency.
Can you please point me what i am missing here?
You cannot do this.
Android and a normal linux have vastly different userspaces, in particular they use entirely different C libraries and associated incompatible dynamic linkers.
The very desire for a versioned library name (the .so.2 - something Android doesn't currently do) is indicative that this library was not build for Android.
You need to rebuild all your libraries using the android ndk either by creating and Android.mk and similar files to drive the normal ndk build system, or by using the ndk utility for generating a "stand alone toolchain" and pointing your project's build system at the resulting android-targeted gcc, ld, etc.
Some people have managed to use normal linux userspace components on rooted devices by putting a whole minimal install of debian-arm or similar in a chroot, but that requires root to set up and would not be linkable from an application process by jni anyway. Your application process is already deeply tied to Android's C library so you can't really substitute another.
这篇关于无法加载库“libdl.so.2"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法加载库“libdl.so.2"
- android 4中的android RadioButton问题 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01