You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
libsentry-tm-perf-logger.so is not 16 KB page aligned after upgrading from 8.16.0 to 8.17.0 #6394
Upgrade @sentry/react-native from 8.16.0 to 8.17.0 in a New Architecture app
Build and install the app on an Android emulator with a 16 KB page size image
Launch the app
Expected Result
No compatibility warning, all native libraries are 16 KB page aligned (as they were with 8.16.0).
Actual Result
On every app start, Android shows the "Android App Compatibility" dialog saying the app is not 16 KB compatible and will run in page size compatible mode. It unhelpfully lists every library with "Unknown error", but I pulled the APK and checked the ELF headers of all 32 libs myself. Exactly one is misaligned, and it is the new one introduced in 8.17.0 by the Turbo Module performance tracking feature (#6307):
lib/arm64-v8a/libsentry-tm-perf-logger.so LOAD align: 4096 (all other libs: 16384)
The library is built from source in the consuming app by android/src/main/jni/CMakeLists.txt, which does not pass -Wl,-z,max-page-size=16384. RN 0.86 / Expo SDK 57 builds with NDK 27, where the linker still defaults to 4 KB alignment (16 KB only became the default in NDK r28), so the resulting .so breaks 16 KB compliance for the whole app. This will presumably also fail Google Play's 16 KB requirement, not just show the emulator dialog.
The usual fix would be adding this to the CMakeLists:
diff --git a/android/src/main/jni/CMakeLists.txt b/android/src/main/jni/CMakeLists.txt
index 4f5e5403b2d15a9e2449ad3ea2478bff03cae1eb..5c4ea0e0a86e5a357d8816f71e8620257e4ea57a 100644
--- a/android/src/main/jni/CMakeLists.txt+++ b/android/src/main/jni/CMakeLists.txt@@ -62,6 +62,17 @@ target_link_libraries(
ReactAndroid::reactnative
)
+# Force 16 KB ELF LOAD segment alignment. NDK's linker still defaults to+# 4 KB (16 KB only became default in NDK r28); every other .so bundled by+# RN/AGP is already 16 KB aligned, but this target isn't unless told to be,+# which trips Android 15+'s 16 KB page-size compatibility check.+# https://github.com/getsentry/sentry-react-native/issues/6394+target_link_options(+ sentry-tm-perf-logger+ PRIVATE+ "-Wl,-z,max-page-size=16384"+)+
# Note: we deliberately do NOT pass `-Wl,--strip-all` (or similar) here.
# Android Gradle Plugin's `StripDebugSymbolsTask` already strips the .so for
# the packaged APK while preserving the unstripped artefact under
Thank you for reporting @tomekzaw and for the suggestion @efstathiosntonas 🙇
We are working on a fix in #6396. We will iterate here when it is release.
Activity
linear-code commentedon Jul 2, 2026
RN-698
efstathiosntonas commentedon Jul 3, 2026
on
arm64-v8aapk:efstathiosntonas commentedon Jul 3, 2026
@sentry__react-native@8.17.0.patchantonis commentedon Jul 3, 2026
Thank you for reporting @tomekzaw and for the suggestion @efstathiosntonas 🙇
We are working on a fix in #6396. We will iterate here when it is release.
test(android): Add CI check for 16 KB native library alignment
docs: Warn about 16 KB alignment issue in 8.17.0 (#6397)
tomekzaw commentedon Jul 3, 2026
@antonis Thank you for the quick fix! 🙏
antonis commentedon Jul 3, 2026
Thank you for helping out with this and sorry for interrupting your workflow. A patch release will be available soon.
github-actions commentedon Jul 3, 2026
A PR closing this issue has just been released 🚀
This issue was referenced by PR #6396, which was included in the 8.17.1 release.
fix(android): Force 16 KB ELF alignment for libsentry-tm-perf-logger.…
efstathiosntonas commentedon Jul 3, 2026
φχαριστουμε Αντωνη 😄
antonis commentedon Jul 3, 2026
Παρακαλώ :) 🇬🇷
test(android): Add ABI coverage and link regression guard for perf-lo…
fix(android): Prevent New Arch build break linking libsentry-tm-perf-…