Skip to content

Commit

Permalink
feat(Android): Add support for 16KB page size (#2702)
Browse files Browse the repository at this point in the history
## Description

Starting from Android 15 devices can use 16KB page size instead of 4KB.
Apps that take advantage of this require additional linker flag.

This PR adds aforementioned flag so that apps that use Screens don't
crash.

>[!NOTE]
> More info can be found
[here](https://developer.android.com/guide/practices/page-sizes)

## Test plan

I've tested it while working on the same change in
[Reanimated](software-mansion/react-native-reanimated#7037).
After adding this flag into screens app stopped crashing.


I've also tested it on `FabricExample` in Screens on AVD with 16KB page
size. I've had some problems with this example app, but after adding
this flag it stopped crashing on start (it still show some errors about
undefined function though, but I believe the problem lies in my setup).
  • Loading branch information
m-bert authored Feb 18, 2025
1 parent a1e388f commit f8afc72
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ android {
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"
}
}
}
Expand Down

0 comments on commit f8afc72

Please sign in to comment.