Skip to content

Conversation

tastydev
Copy link
Contributor

@tastydev tastydev commented Sep 30, 2025

Hello,

this pr fixes #96 and #94.

Build errors fixed for RN >=0.80 and also for EXPO SDK 54 by using the c++17 standard now as it aligns better with the current NDK toolchain.

Android 16KB paging is supported now. Root RN still compiles with NDK 27 which needs -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON to be set as mentioned inside the docs: https://developer.android.com/guide/practices/page-sizes#compile-r27

Paging support before:
47cff490a8ad444b4906e452aa91a022

Paging support after:
50554b455d81ddd19e1c7c6e13c6cf7d

Summary by CodeRabbit

  • Chores
    • Updated Android build configuration to support flexible page sizes, improving compatibility and potential memory efficiency on newer devices.
    • Upgraded native compilation standard to C++17 to enhance stability, performance, and future compatibility across Android builds.

this fixes jerson#96

Upgrading to C++17 helps because the NDK may have better support or defaults for standard library features in newer toolchains.
This allow the code to be compiled for android 16kb paging
Copy link

coderabbitai bot commented Sep 30, 2025

Walkthrough

Updates Android native build configuration: CMake now targets C++17, and Gradle passes an additional CMake argument enabling Android flexible page sizes. No other linking or control-flow changes.

Changes

Cohort / File(s) Summary of Changes
CMake configuration
android/CMakeLists.txt
Set CMAKE_CXX_STANDARD from 14 to 17; retained existing target_link_libraries (formatting-only newline change).
Gradle build configuration
android/build.gradle
Adds CMake argument: -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON alongside existing NODE_MODULES_DIR argument.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A bunny taps CMake with gentle might,
From fourteen hops to seventeen in sight.
Gradle sprinkles flags with airy graces,
Flexible pages find their places.
I thump the ground—compile delight!
Our warrens build clean through the night. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The addition of the Android flexible page‐size flag in android/build.gradle, while useful, does not relate to issue #96’s goal of fixing the snprintf compilation error and therefore represents an unrelated change. Either remove the flexible page-size flag change from this PR or add the corresponding linked issue that calls for Android 16 KB paging support.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and concisely summarizes the two primary features introduced—support for React Native versions 0.80 and above and Android 16 KB paging support—in a single, readable sentence without extraneous information.
Linked Issues Check ✅ Passed By bumping the C++ standard to C++17 in android/CMakeLists.txt, the pull request aligns with NDK r27 toolchain requirements and resolves the std::snprintf compile error under Expo SDK 54 and React Native ≥ 0.80, directly satisfying issue #96’s objective.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6dd6f8e and 9362773.

📒 Files selected for processing (2)
  • android/CMakeLists.txt (2 hunks)
  • android/build.gradle (1 hunks)
🔇 Additional comments (3)
android/CMakeLists.txt (2)

4-4: LGTM! C++17 standard resolves NDK r27 compilation issues.

This change addresses the compilation errors with Expo SDK 54 and React Native >= 0.80 by aligning with the current NDK toolchain requirements.


33-36: LGTM! Linking configuration is correct.

The target_link_libraries configuration properly links the required libraries (rsa_bridge, android, log) for the native module.

android/build.gradle (1)

68-74: LGTM! Flexible 16KB page size support correctly enabled.

The addition of -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON ensures CMake builds on NDK r27 support 16KB page sizes (r27 defaults to 4KiB) (github.com). Starting in NDK r28+, 16KiB compatibility is enabled by default, so no further changes will be required when upgrading (newreleases.io).


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

Comment @coderabbitai help to get the list of available commands and usage tips.

@jerson jerson merged commit 2262064 into jerson:master Sep 30, 2025
1 check passed
@jerson
Copy link
Owner

jerson commented Sep 30, 2025

@tastydev Thank You for this

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.

Error compiling in Expo 54
2 participants