Skip to content

Comments

fix: copy Android JNI libs as libapp.a to match uniffi-generated CMakeLists#153

Merged
afilini merged 2 commits intomasterfrom
fix/react-native-libapp-jnilib-name
Feb 20, 2026
Merged

fix: copy Android JNI libs as libapp.a to match uniffi-generated CMakeLists#153
afilini merged 2 commits intomasterfrom
fix/react-native-libapp-jnilib-name

Conversation

@portal-wheatley
Copy link
Contributor

Problem

After the rearchitecture in #133 (crate renamed appportal-app → reverted back to app), the react-native/flake.nix was updated to copy the Android JNI libraries under the wrong filename:

# before this fix
cp ${libAndroidAarch64}/lib/libapp.a android/src/main/jniLibs/arm64-v8a/libportal.a
cp ${libAndroidX86_64}/lib/libapp.a android/src/main/jniLibs/x86_64/libportal.a

uniffi-bindgen-react-native generates a CMakeLists.txt that references the library by the Rust crate name — which is app, so it looks for libapp.a. Since the flake was copying it as libportal.a, the Android build failed:

ninja: error: 'src/main/jniLibs/arm64-v8a/libapp.a', needed by 'libportal-app-lib.so', missing

Fix

Keep the destination filename consistent with the crate name:

cp ${libAndroidAarch64}/lib/libapp.a android/src/main/jniLibs/arm64-v8a/libapp.a
cp ${libAndroidX86_64}/lib/libapp.a android/src/main/jniLibs/x86_64/libapp.a

…eLists

uniffi-bindgen-react-native generates CMakeLists.txt referencing libapp.a
(based on the Rust crate name), but the flake was copying the library
as libportal.a. This caused Android builds to fail with:

  ninja: error: 'src/main/jniLibs/arm64-v8a/libapp.a' missing

Fix: keep the destination filename consistent with the crate name (app).
@afilini afilini merged commit e840e62 into master Feb 20, 2026
6 checks passed
@afilini afilini deleted the fix/react-native-libapp-jnilib-name branch February 20, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants