Repository navigation
fix(android): align librnmbxnav.so to 16 KB page size - #36
Open
alternacrow wants to merge 1 commit into
Open
alternacrow wants to merge 1 commit into
alternacrow wants to merge 1 commit into
Conversation
NDK r27 only emits 16 KB-aligned segments when ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES is set; it became the default in r28. Without it, librnmbxnav.so is linked with 4 KB alignment and apps that bundle it are flagged as incompatible on Android 15+ devices with 16 KB pages. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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
librnmbxnav.sois linked with 4 KB segment alignment, so apps that bundle@rnmapbox/navigationare reported as incompatible with 16 KB page size devices on Android 15+. Google Play requires 16 KB support for apps targeting Android 15 and above.In an app using
@rnmapbox/navigation@0.1.2,librnmbxnav.sowas the only one of the 47arm64-v8alibraries in the APK that was not 16 KB aligned:The device shows a compatibility warning for the app because of this one library.
Cause
NDK r27 only passes
-Wl,-z,max-page-size=16384whenANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ONis set; it became the default in r28.android/build.gradlepasses only-DANDROID_STL=c++_sharedto CMake, so the flag is missing from the link command.Other React Native libraries that ship native code already set it, e.g.
react-native-screensandreact-native-reanimated.Fix
Add
-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ONto the CMake arguments. This is a no-op on NDK r28+, where it is already the default.Verification
Rebuilt the same app with the patch applied:
Built with Expo SDK 58 / React Native 0.88, NDK 27.1.12297006.
🤖 Generated with Claude Code