You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into this issue which I posted in the UniFFI repo, they said it's not specifically an UniFFI issue so I thought maybe its an cargo-ndk issue? I'd appreciate the feedback:
UnsatisfiedLinkError: cannot locate symbol "SSL_do_handshake" in librustcore.so on Android
This probably has to do with: reqwest crate and its dependencies
Issue Description The application crashes on just calling any Rust function, even "say_hello() -> String" from Kotlin in simulator and on a SamsungS20FE with an UnsatisfiedLinkError. The same Rust core works reliably in iOS.
Steps to Reproduce (on MacMini M4) Build the rust-library:
# Set up cargo-ndk and add the Android targets
cargo install cargo-ndk
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
# Build the dylib
cargo build
# Build the Android libraries in jniLibs
cargo ndk -o ./android/app/src/main/jniLibs \
--manifest-path ./Cargo.toml \
-t armeabi-v7a \
-t arm64-v8a \
-t x86 \
-t x86_64 \
build
# Create Kotlin bindings
cargo run --bin uniffi-bindgen generate --library ./target/debug/librustcore.dylib --language kotlin --out-dir ./out
# copy to to android project
Build and install the application on an Android device/emulator.
Launch the application.
Run a test function even as simple as say_hi(text: String) -> String {} which instantly crashes and closes the app on Android but not in iOS
Expected Behavior Android should just work like it does on iOS.
Actual Behavior Using no tls feature or "default-tls" or "rustls-tls" as reqwest features:
java.lang.UnsatisfiedLinkError: Unable to load library 'rustcore':
dlopen failed: cannot locate symbol "SSL_do_handshake" referenced by "/data/app/~~jBO-LA02dhvPb-R3c4eRgw==/dev.ryk.rustandroid-0jMgQkCi7UfLCOJEc3R4bw==/base.apk!/lib/arm64-v8a/librustcore.so"...
...
Native library (android-aarch64/librustcore.so) not found in resource path (.)
Using "native-tls" in reqwest feature:
java.lang.UnsatisfiedLinkError: Unable to load library 'rustcore':
dlopen failed: cannot locate symbol "BIO_meth_new" referenced by "/data/app/~~B-NPyDxI9tcSIpM8hLlzPQ==/dev.ryk.rustandroid-wKpl05lBlHfXOhfOAT9hRA==/base.apk!/lib/arm64-v8a/librustcore.so"...
...
Native library (android-aarch64/librustcore.so) not found in resource path (.)
Tried
Installed openSSL 3 and 3.5 using homebrew, set paths to:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I ran into this issue which I posted in the UniFFI repo, they said it's not specifically an UniFFI issue so I thought maybe its an cargo-ndk issue? I'd appreciate the feedback:
Beta Was this translation helpful? Give feedback.
All reactions