-
Notifications
You must be signed in to change notification settings - Fork 31
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
libc++_shared.so
is included in the APK with NDK 24.0.8215888, not with 21.4.7075529 or 23.1.7779620
#13
Comments
On my local machine, |
In fact, even if I manually copy |
I was able to switch over to NDK r24 using https://github.com/nttld/setup-ndk, and now It was not immediately obvious however, that the correct environment variable to set (the one that is checked first) was So even though my problem is now fixed, it would be nice if this still worked with NDK < r24, so that this extra step wouldn't be needed, and some more headache could be spared for others in the future. |
Note that you can link to lines in build steps directly: https://github.com/torokati44/ruffle-android/runs/5707487779?check_suite_focus=true#step:5:810 As you pointed to rust-mobile/ndk#20, Please be more specific (logs...) about any linker errors that appear. Include EDIT: Since your project seems to be using |
Right, thanks for the tip! I have set up a tiny repo with a bunch of crates to reproduce a similar situation easier: https://github.com/torokati44/cargo-apk-cpp-test The linker error in this case is, at runtime:
The output of
And with NDK 24:
The output of With NDK 21:
With NDK 24:
|
I'm surprised. You even added |
Yes, without that, it doesn't work even with NDK 24. |
In case this helps, I am using oboe and ran into this error. I was able to solve it by adding the following to my #[cfg_attr(target_os = "android", link(name = "c++_shared"))]
extern "C" {} |
This has caused my app to work when built locally, but not when built by GitHub Actions, as that still defaults to 21.4.7075529.
See: https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#environment-variables-3
See the last 8-10 lines of the "Build native libs" section of the output in this build: https://github.com/torokati44/ruffle-android/runs/5707487779?check_suite_focus=true
Under
882 lib/arm64-v8a/libruffle_android.so (OK - compressed)
there should be another line aboutlibc++_shared.so
, because inbuild.rs
I askrustc
to link to it.Relevant PR: rust-mobile/ndk#20
Switching to NDK 23.1.7779620 by setting
$ANDROID_NDK_ROOT
to$ANDROID_NDK_LATEST_HOME
still doesn't solve it, see the same lines of output here: https://github.com/torokati44/ruffle-android/runs/5712219430?check_suite_focus=trueThe text was updated successfully, but these errors were encountered: