fix(android): Correct New Architecture native-build gate to RN 0.76+#6407
Merged
Conversation
The `libsentry-tm-perf-logger.so` native build is gated on the host RN version because it links the `ReactAndroid::reactnative` prefab. That merged prefab target only exists from RN 0.76 onward (RN 0.76 introduced the unified libreactnative.so; 0.75 and earlier split the native code across separate prefab modules). The gate used `minor >= 75`, so on RN 0.75.x with New Architecture enabled CMake would try to link a non-existent target and fail at the configure step. Change the gate to `minor >= 76` so RN 0.75.x New Arch builds skip the native target instead of breaking. TurboModule perf tracking already degrades to a no-op when the library is absent. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
Contributor
Author
|
@sentry review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 56939c2. Configure here.
11 tasks
📲 Install BuildsAndroid
|
Contributor
Android (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| f170ec3+dirty | 505.96 ms | 551.88 ms | 45.92 ms |
| b04af96+dirty | 430.33 ms | 485.98 ms | 55.65 ms |
| 7887847+dirty | 420.47 ms | 460.55 ms | 40.08 ms |
| eb93136+dirty | 500.37 ms | 532.58 ms | 32.21 ms |
| c2e182c+dirty | 468.50 ms | 545.44 ms | 76.94 ms |
| d0e3b3e+dirty | 443.19 ms | 480.00 ms | 36.81 ms |
| 0a147b2+dirty | 442.80 ms | 522.24 ms | 79.44 ms |
| d038a14+dirty | 405.08 ms | 444.36 ms | 39.28 ms |
| 890d145+dirty | 486.42 ms | 514.85 ms | 28.43 ms |
| 15d4514+dirty | 413.63 ms | 449.62 ms | 35.99 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| f170ec3+dirty | 48.30 MiB | 53.57 MiB | 5.26 MiB |
| b04af96+dirty | 49.74 MiB | 55.00 MiB | 5.26 MiB |
| 7887847+dirty | 49.74 MiB | 54.81 MiB | 5.07 MiB |
| eb93136+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| c2e182c+dirty | 49.74 MiB | 54.85 MiB | 5.11 MiB |
| d0e3b3e+dirty | 49.74 MiB | 55.09 MiB | 5.34 MiB |
| 0a147b2+dirty | 49.74 MiB | 55.08 MiB | 5.34 MiB |
| d038a14+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
| 890d145+dirty | 43.94 MiB | 49.00 MiB | 5.06 MiB |
| 15d4514+dirty | 48.30 MiB | 53.60 MiB | 5.30 MiB |
alwx
approved these changes
Jul 6, 2026
alwx
left a comment
Contributor
There was a problem hiding this comment.
Looks good.
But I think one-line PRs could really be done without Claude and 10 lines of comments that come with Claude :)
Contributor
Android (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 0d9949d+dirty | 403.57 ms | 437.00 ms | 33.43 ms |
| 64630e5+dirty | 419.18 ms | 464.58 ms | 45.40 ms |
| 853723c+dirty | 405.54 ms | 440.08 ms | 34.54 ms |
| 1122a96+dirty | 422.22 ms | 464.33 ms | 42.10 ms |
| 5748023+dirty | 446.69 ms | 505.63 ms | 58.94 ms |
| eb93136+dirty | 416.18 ms | 467.32 ms | 51.14 ms |
| 4e0ba9c+dirty | 452.84 ms | 473.36 ms | 20.52 ms |
| c2e182c+dirty | 471.64 ms | 553.59 ms | 81.95 ms |
| a0d8cf8+dirty | 411.71 ms | 467.57 ms | 55.87 ms |
| d0e3b3e+dirty | 421.53 ms | 498.19 ms | 76.66 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 0d9949d+dirty | 43.75 MiB | 48.13 MiB | 4.37 MiB |
| 64630e5+dirty | 49.74 MiB | 54.82 MiB | 5.07 MiB |
| 853723c+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| 1122a96+dirty | 48.30 MiB | 53.54 MiB | 5.24 MiB |
| 5748023+dirty | 48.30 MiB | 53.54 MiB | 5.23 MiB |
| eb93136+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| 4e0ba9c+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
| c2e182c+dirty | 49.74 MiB | 54.85 MiB | 5.11 MiB |
| a0d8cf8+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
| d0e3b3e+dirty | 49.74 MiB | 55.09 MiB | 5.34 MiB |
This was referenced Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
The
libsentry-tm-perf-logger.sonative build (added in 8.17.0, #6307) is gated on the host app's React Native version because it links theReactAndroid::reactnativeprefab. That gate was off by one:The merged
libreactnative.so— exposed as theReactAndroid::reactnativeprefab selector — was introduced in React Native 0.76. On RN 0.75 and earlier, the native code is split across separate prefab modules (react_nativemodule_core, etc.) andReactAndroid::reactnativedoes not exist. With the oldminor >= 75gate, an app on RN 0.75.x withnewArchEnabled=truewould run our CMake build, which callsfind_package(ReactAndroid REQUIRED CONFIG)+target_link_libraries(... ReactAndroid::reactnative)against a target that isn't there — failing at the CMake configure step, before any linking.💡 Motivation and Context
Found while investigating the class of build failures around this app-compiled library (#6394, #6398). Unlike the armeabi-v7a link failure (#6406), this one fails at configure time, so a linker flag can't rescue it — the gate itself must be correct.
Verified the version boundary directly:
reactnativeprefab (split modules only)reactnativeprefab present,TurboModulePerfLogger::enableLoggingexportedlibreactnative.soshipped in 0.76 (release notes, RFC #816)With the fix, RN 0.75.x New Arch builds simply skip the native target (TurboModule perf tracking degrades to a no-op when the library is absent), instead of breaking the build.
💚 How did you test it?
Confirmed the prefab-availability boundary against cached RN AARs (0.72 vs 0.85/0.86) and RN's own release documentation. The change is a one-line version-gate correction with updated explanatory comments; RN 0.76+ New Arch behaviour is unchanged (still builds the native target).
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps