Skip to content

[Android] Add support for 16KB page size compatibility (Android 15+) #3952

@Manishbajpai055

Description

@Manishbajpai055

Summary

Apps using react-native-screens crash on Android 15+ devices with 16KB page size configurations. This patch fixes that by updating the CMake build configuration.

Background

Android 15 introduced support for 16KB memory page sizes. Apps must explicitly support this to run on affected devices and meet Google Play Store requirements.

Changes

node_modules/react-native-screens/android/build.gradle

externalNativeBuild {
    cmake {
        arguments "-DANDROID_STL=c++_shared",
-                 "-DRNS_NEW_ARCH_ENABLED=${IS_NEW_ARCHITECTURE_ENABLED}"
+                 "-DRNS_NEW_ARCH_ENABLED=${IS_NEW_ARCHITECTURE_ENABLED}",
+                 "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
    }
}

Environment

  • react-native: 0.78.0
  • react-native-screens: 3.37.0
  • Android NDK: 27.1.12297006
  • New Architecture: enabled
  • Target SDK: 35

Impact

Without patch: crashes on Android 15+ 16KB page size devices.
With patch: compatible with both 4KB and 16KB page size devices.

Testing

Verified on Android 15 emulator (16KB page size) and standard 4KB devices, debug and release, all architectures.

References


Metadata

Metadata

Assignees

No one assigned

    Labels

    missing-infoThe user didn't precise the problem enoughmissing-reproThis issue need minimum repro scenarioplatform:androidIssue related to Android part of the library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions