Skip to content

[Android] 16KB Page Size Compatibility Issue in React Native Core Libraries #52594

Description

@amanchd16

Description

Priority: High - Affects all React Native Android apps and Google Play Store compatibility 🚨

Summary

React Native core libraries (libjsi.so, libreactnative.so, libhermes.so, libhermestooling.so, libfbjni.so, libc++_shared.so) are not compatible with Android's 16KB page size requirement on 32-bit architectures, causing Google Play Store warnings and potential crashes on devices with 16KB page sizes.

Environment

React Native version: 0.80.0 / 1
Platform: Android
NDK version: 27.1.122
Architecture affected: armeabi-v7a, x86 (32-bit architectures)
Architecture working: arm64-v8a, x86_64 (64-bit architectures)
Build tools: 35.0.0

Google Play Store now enforces 16KB page size compatibility for Android apps. Our analysis reveals that React Native's core native libraries have page alignment issues on 32-bit architectures, while 64-bit architectures work correctly.

❌ Problem architectures (aligned to 0x4 - 4KB):

armeabi-v7a/libjsi.so - JavaScript Interface
armeabi-v7a/libreactnative.so - React Native Core
armeabi-v7a/libhermes.so - Hermes JavaScript Engine
armeabi-v7a/libhermestooling.so - Hermes Tooling
armeabi-v7a/libfbjni.so - Facebook JNI
armeabi-v7a/libc++_shared.so - C++ Standard Library
x86/libjsi.so
x86/libreactnative.so
x86/libhermes.so
x86/libhermestooling.so
x86/libfbjni.so
x86/libc++_shared.so

✅ Working architectures (aligned to 0x4000 - 16KB):

arm64-v8a/libjsi.so
arm64-v8a/libreactnative.so
arm64-v8a/libhermes.so
arm64-v8a/libhermestooling.so
arm64-v8a/libfbjni.so
arm64-v8a/libc++_shared.so
x86_64/* (all corresponding libraries)

Request

This is a critical compatibility issue affecting all React Native Android applications. Please prioritize updating the build configuration to ensure all React Native core libraries support 16KB page sizes across all architectures.
Suggested timeline: This should be addressed in the next patch release due to its impact on Google Play Store compatibility.

Steps to reproduce

Reproducer: RNTesterPlayground.js is not applicable for this issue.

This is a native library build configuration issue, not a JavaScript runtime issue. The problem exists in how React Native's native libraries (.so files) are compiled and linked by the NDK build system.

To reproduce the actual issue:

  1. Build any React Native Android app
  2. Extract the APK: unzip app-release.apk -d extracted/
  3. Analyze native libraries: objdump -x extracted/lib/armeabi-v7a/libreactnative.so | grep Align
  4. Observe 4KB alignment (0x4) instead of required 16KB alignment (0x4000)

JavaScript code cannot reproduce this because it's a compilation/linking issue that affects the ELF binary format of native libraries, not runtime behavior.

React Native Version

0.80.1

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info

System:
  OS: macOS 15.5
  CPU: (8) arm64 Apple M1
  Memory: 144.73 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.0.0
    path: ~/.nvm/versions/node/v22.0.0/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.5.1
    path: ~/.nvm/versions/node/v22.0.0/bin/npm
  Watchman:
    version: 2025.04.14.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/amandhiman/.rvm/gems/ruby-2.7.5/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK:
    Android NDK: 22.1.7171670
IDEs:
  Android Studio: 2024.3 AI-243.26053.27.2432.13536105
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 23.0.1
    path: /usr/bin/javac
  Ruby:
    version: 2.7.5
    path: /Users/amandhiman/.rvm/rubies/ruby-2.7.5/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 19.0.0
    wanted: 19.0.0
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native:
    installed: 0.80.0
    wanted: 0.80.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

 ❌ Not 16KB aligned
Checking: ./armeabi-v7a/libfbjni.so
  Align: 0x4
 ❌ Not 16KB aligned
Checking: ./x86/libfbjni.so
  Align: 0x4
  ❌ Not 16KB aligned
Checking: ./armeabi-v7a/libreactnative.so
  Align: 0x4
  ❌ Not 16KB aligned
Checking: ./x86/libreactnative.so
  Align: 0x4
❌ Not 16KB aligned
Checking: ./armeabi-v7a/libhermestooling.so
  Align: 0x4
  ❌ Not 16KB aligned
Checking: ./armeabi-v7a/libhermes.so
  Align: 0x4
 ❌ Not 16KB aligned
Checking: ./x86/libhermestooling.so
  Align: 0x4
  ❌ Not 16KB aligned
Checking: ./x86/libhermes.so
  Align: 0x4
  ❌ Not 16KB aligned
Checking: ./armeabi-v7a/libjsi.so
  Align: 0x4
  ❌ Not 16KB aligned
Checking: ./x86/libjsi.so
  Align: 0x4

MANDATORY Reproducer

https://github.com/amanchd16/taxy

Screenshots and Videos

High Impact Issue:

  • Affects ALL React Native Android apps
  • Google Play Store shows warnings about 16KB page size compatibility
  • Apps may crash on devices with 16KB page sizes
  • Future Android versions may reject apps without 16KB compatibility
  • Affects app distribution and user experience

16KB Libs.pdf

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions