Open bc-lee opened 3 weeks ago
:warning: | Missing Reproducible Example |
---|---|
:information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
I think React-Native should support the 16KB page size for the future.
Agree. We haven't planned support for 16K page size in the near future as we're focused on rolling out the New Architecture.
To unblock yourself you can however:
-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON
parameter as suggested in the guide (you'll have to patch.package also node_modules/react-native/ReactAndroid/build.gradle.kts
to pass that config there as well).I created the following repo where I use RN 0.74.3. (Repo)
As a result, I got the following exception after the app launched:
2024-07-14 15:42:38.414 3431-3431 libc com.elf16check
A Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x7299c27d4cc0 in tid 3431 (com.elf16check), pid 3431 (com.elf16check)
2024-07-14 15:42:40.597 3502-3502 DEBUG crash_dump64
A Cmdline: com.elf16check
2024-07-14 15:42:40.598 3502-3502 DEBUG crash_dump64
A pid: 3431, tid: 3431, name: com.elf16check >>> com.elf16check <<<
Description
Android 15 offers an option for OEMs to use a 16KB page size for better performance [1]. This change is significant, as all shared objects (
.so
files in APKs) must be recompiled with the new page size. According to the Android team [2][3], 16KB page size compatibility will be required for app uploads to the Play Store next year (2025).It seems that React-Native is not compatible with the 16KB page size. If I try to run a React-Native project on an emulator with a 16KB page size, I get the following error in the logcat:
I checked all shared objects in the APK using my script check_elf_page_size.py and found that all shared objects use a 4KB page size.
(Of course, one can manually check the page size of each shared object using the
readelf -Wl
command.)I think React-Native should support the 16KB page size for the future.
[1] https://developer.android.com/guide/practices/page-sizes [2] https://android-developers.googleblog.com/2024/05/the-second-beta-of-android-15.html [3] https://issuetracker.google.com/issues/346830813#comment3
Steps to reproduce
npx react-native init
.npx expo run:android
.React Native Version
0.74.2
Affected Platforms
Runtime - Android
Output of
npx react-native info
Stacktrace or Logs
Reproducer
npx create-expo-app@latest
Screenshots and Videos