-
Notifications
You must be signed in to change notification settings - Fork 366
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
Compiled binaries do not run on really old Android versions #1195
Comments
Hi! To target an older android, you'll need to clone the cross repository and initialize the submodule Then see this wiki entry: https://github.com/cross-rs/cross/wiki/FAQ#android-version-configuration Hopefully that helps, here is the dockerfile we use https://github.com/cross-rs/cross/blob/main/docker/Dockerfile.armv7-linux-androideabi#L16-L18 If you get into any issue, let us know! |
That sounds...complicated :( Would it be possible to either default to a really old Android version (because Android NDK is forwards-compatible), or expose this through some sort of runtime flag? |
(note I don't really understand how android versioning work so take this with a grain of salt and feel free to educate/correct me!) Just leaving some breadcrumbs here, not strictly related to your question. Notesthe NDK may be forward-compatible, but I don't think rust supports older APIs, what api do you need? rust < 1.68 supports 15 (via NDK r17), and the releases after tomorrows release (which would be 1.68) will be api 19 (via NDK r23). It seems the fix to your problem is available here
The fixThe fix for you would be an environment with sdk 21, right? To do this, you'll need to do
which will spit out an image I'll see what we can do about creating some images that people commonly use so it's easier (you'd only have to change the image used), that is part of #1155 |
Yeah that seems ideal. I don't need versions that old (21 is enough), but I think that Android 9 is too new to be a good default, considering a very significant fraction of phones, especially in 3rd world countries, run older Androids. I'd suggest "the oldest Android version that the latest NDK supports" as a sane default |
Checklist
Describe your issue
On Android 5, compiled binaries fail to run with messages on stderr like:
From some googling, this looks like it's targeting too new of an Android SDK version. Is there any place where this can be configured?
What target(s) are you cross-compiling for?
aarch64-linux-android, armv7-linux-androideabi
Which operating system is the host (e.g computer cross is on) running?
What architecture is the host?
What container engine is cross using?
cross version
cross 0.2.4 (80c9f91 2023-01-20)
Example
No response
Additional information / notes
No response
The text was updated successfully, but these errors were encountered: