Closed fr-an-k closed 6 days ago
Transferring to glutin
as this has nothing to do with winit
.
It used to be the case that naming the Rust library libandroid.so
caused trouble ^1, because Android... also provides libandroid.so
. But it seems https://github.com/rust-windowing/glutin/commit/26a21fe73a3d6b4b403d1256b2e184ea2568d921#diff-f7f21ed25a8ba280480db849c25c183fc06f9f8bae3c7200bca2b2076af5ecf5 slipped through the cracks, as if this is no longer a problem on recent Android.
Can you test out https://github.com/MarijnS95/glutin/compare/android-app-lib-name just in case (replace the command with --example android_app
)? Those errors back then used to be a bit different, perhaps there's different incompatibilities that would need to be solved on the xbuild
/cargo-apk
side though I doubt anyone is going to help out supporting an Android version that's EOL for well over 8 years.
https://github.com/rust-mobile/ndk/issues/250#issuecomment-1076228905
https://github.com/rust-mobile/ndk/issues/143#issuecomment-829500467
I followed the readme exactly, with the min_sdk_version set one lower for 5.1. I renamed it to android2 the same way as your changes, but it didn't do the trick. I know 5.1 is nasty, that's why I'm going low-level. It's just strange that no reason is given why the native library won't load, maybe someone had an idea.
closing since it's an ndk issue and not glutin.
Yeah, fine to close this as it doesn't seem to be caused by the libandroid.so
naming conflict inside Glutin. And this Android version is completely EOL anyway.
If anyone is interested in debugging this they should see if C++ NativeActivity
apps compiled via official tooling actually work, and then try to use said toolchain - at least the linker - in Rust to have a more-or-less apples-to-apples comparison. Though technically cargo-apk
already utilizes min_sdk_version
to select the right cross-compiler/linker from the toolchain.
The Android 5.1 device that I need to support fails to load a minimal example (feature "android-native-activity", no default), whatever I try, but works on other devices like 8.1. I used cargo apk.
It's not able to load libandroid.so
The only hint are warnings about unused DT entries, but I don't think that's the cause. Any ideas on what step I could take?
This was based on https://github.com/rust-windowing/glutin with this added to glutin_examples/Cargo.toml:
Then:
Which causes the issue; when I strip it to the minimum, the issue remains.