DioxusLabs / DioxusLabs/dioxus

dx build --platform android: OpenSSL .so not bundled in APK

Open
#5,565 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

## Summary

When building a Dioxus 0.7.9 app for Android with `dx build --platform android`, the generated APK does not include the OpenSSL shared libraries (`libssl.so`, `libcrypto.so`) that dx itself provides as prebuilts.

## Steps to Reproduce

1. Create a Dioxus app with `features = ["desktop"]` or `features = ["native"]`
2. Run `dx build --platform android`
3. Install the APK via `adb install`
4. Launch the app

## Expected

App launches successfully. The prebuilt OpenSSL `.so` files from `~/.local/share/.dx/prebuilt/openssl-*/ssl/libs/android.*/` should be bundled into the APK's `lib//` directory.

## Actual

App crashes immediately with:
```
java.lang.UnsatisfiedLinkError: dlopen failed: library "libssl.so" not found:
needed by .../lib/arm64/libmain.so in namespace clns-4
```

## Workaround

Manually copy the `.so` files to the Gradle project's `jniLibs` directory and rebuild with Gradle:
```bash
JNILIBS="target/dx//debug/android/app/app/src/main/jniLibs"
mkdir -p "$JNILIBS/arm64-v8a"
cp ~/.local/share/.dx/prebuilt/openssl-*/ssl/libs/android.arm64-v8a/lib{ssl,crypto}.so "$JNILIBS/arm64-v8a/"
cd target/dx//debug/android/app
./gradlew assembleDebug
```

## Environment

- dx 0.7.9
- Android NDK 27.2
- Rust 1.94.1
- Host: Linux x86_64
- Device: aarch64 (arm64-v8a)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.