-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to load native library: /data/app-lib/*/lib*.so #446
Comments
Update: After hours and days of researching and going through hell, nothing helped to get anywhere... UNTIL I decided to manually load the library via android studio (
getifaddrs function (or ifaddrs header) native support exists since android 7.0 (NDK >= 24). For NDKs below 24 (or androids below 7.0), I found this repo for the implementation: https://github.com/morristech/android-ifaddrs Not sure exactly how to go from here. Am I supposed to compile the custom c code in rust, so the final built .so file has it (using the |
Hi, I faced same problem, I'm tried to create rust bindings for I investigated little bit more and know for sure that I can use following code to call this function inside my lib
So at this point I knows that only static linking don't work correctly.
|
UPDATE I forgot to link shared libraries Following lines were missed in println!(r"cargo:rustc-link-lib={}", "EGL");
println!(r"cargo:rustc-link-lib={}", "GLESv3");
For example on screenshot above P.S For |
I managed to compile, get the .so file, and then package an apk based on it. However, no matter what I try, I keep getting this error over and over again. It just can't load the native library, even though it's compiled based on the device's architecture (armv6). I use the
arm-linux-androideabi
target in order to get the final lib .so file.I use ndk r16b, which is the last ndk to support armeabi.
For compilation of the
.so
file, I pass through theCARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER
flag with the value of/home/porya/Android/Sdk/ndk/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld
. Furthermore, I also link the libraries in the build.rs:The full error report in
adb logcat
:I also tried checking the dependencies for
libtrs_24.so
usingreadelf
and my android system has all of them.Is there a way to find the root cause? Am I missing something? Any ideas on where to start is appreciated.
The text was updated successfully, but these errors were encountered: