fix(android): link native libs with 16 KB page alignment - #81
Merged
Conversation
The three libraries this module compiles from source (libfishjam-webrtc-audio, libwebrtc-custom-audio-track, libwebrtc-custom-video-track) were linked with 4 KB page alignment on NDK r27, so Google Play rejected app bundles with "does not support 16 KB memory page sizes". Pass ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON to CMake, like React Native, Expo and Reanimated do; on NDK r27 this adds -Wl,-z,max-page-size=16384 for arm64-v8a/x86_64, on r28+ it is already the default. FCE-3717
czerwiukk
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Google Play rejects app bundles containing
@fishjam-cloud/react-native-webrtc@0.29.0built with NDK r27 (the React Native 0.77–0.81 default): "Your app does not support 16 KB memory page sizes."Three libraries are 4 KB-aligned (
p_align 0x1000), and all three are the ones this fork compiles from source:libfishjam-webrtc-audio.solibwebrtc-custom-audio-track.solibwebrtc-custom-video-track.soEverything else (RN core, prefab
libjsi/libfbjni/libc++_shared, prebuiltlibjingle_peerconnection_so.so) is already0x4000. Upstream react-native-webrtc compiles no native code, so there is nothing to port — the fix is ours.Fix
Pass
-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ONto CMake, the same argument React Native core, Hermes, Expo modules core, Reanimated, Worklets, Screens and Gesture Handler pass. On NDK r27 it adds-Wl,-z,max-page-size=16384for arm64-v8a/x86_64; on r28+ it is already the default (no-op). ThendkVersionfallback stays at27.1.12297006to match React Native's own default.Verification
Built
examples/mobile-client/fishjam-chat(Expo 54 / RN 0.81.5, NDK 27.1.12297006, the failing configuration) forarm64-v8a,x86_64after a clean ofandroid/buildandandroid/.cxx:build.ninjanow containsmax-page-size=16384forarm64-v8aandx86_64only (32-bit ABIs untouched).llvm-readelf -lWover every 64-bit.soin the release APK: 52/52LOADsegments at0x4000, including the three libs above (before:0x1000).zipalign -c -P 16 -v 4 app-release.apk→ Verification successful.0x4000;bundletool dump config→PAGE_ALIGNMENT_16K.UnsatisfiedLinkError/ crash in logcat.Closes FCE-3717.