Skip to content

fix(android): Remove unused RNSentryReplayFragmentLifecycleTracer - #6803

Open
antonis wants to merge 3 commits into
mainfrom
fix/android-replay-excluded-build
Open

antonis wants to merge 3 commits into
mainfrom
fix/android-replay-excluded-build

Conversation

@antonis

@antonis antonis commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Deletes RNSentryReplayFragmentLifecycleTracer.java and its test.

The class hard-imports io.sentry.android.replay.ReplayIntegration. Since packages/core/android/libs/replay-stubs.jar only stubs DefaultReplayBreadcrumbConverter, the @sentry/react-native Android module fails compileDebugJavaWithJavac with cannot find symbol class ReplayIntegration whenever an app excludes sentry-android-replay (a documented way to reduce APK size).

The class is dead code: #5321 (7.5.0) added it to fix session-replay orientation misalignment on Android, but #5582 (8.0.0) removed its only instantiation (initFragmentReplayTracking()), leaving the class and its test orphaned. It has never executed on any 8.x release.

Its purpose — notifying ReplayIntegration.onWindowSizeChanged() on rotation — is now handled natively by sentry-android-replay's WindowRecorder:

Both are included in the bundled sentry-android 8.58.0, so the RN-side tracer is redundant.

💡 Motivation and Context

Fixes #6802.

💚 How did you test it?

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

🔮 Next steps

antonis and others added 2 commits September 29, 2026 16:33
It hard-imported io.sentry.android.replay.ReplayIntegration, which broke the
Android build when the app excludes sentry-android-replay (issue #6802) because
replay-stubs.jar only stubs DefaultReplayBreadcrumbConverter.

The class has been dead since 8.0.0 (#5582 removed its only instantiation) and
the orientation-change handling it provided (#5321) is now done natively by
sentry-android-replay's WindowRecorder (sentry-java #4354 + #5333), verified
on-device for both canvas and pixelCopy screenshot strategies.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@antonis antonis added the ready-to-merge Triggers the full CI test suite label Sep 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

⚪ None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • fix(android): Remove unused RNSentryReplayFragmentLifecycleTracer by antonis in #6803
  • fix(ios): Preserve quoted Expo bundle script invocations by eliotgevers in #6796
  • chore(deps): bump ip-address from 10.4.0 to 10.7.2 by dependabot in #6799
  • chore(deps): bump fast-uri from 3.1.6 to 3.1.8 by dependabot in #6797
  • chore(deps): update Sentry Android Gradle Plugin to v6.23.0 by github-actions in #6798
  • build(deps): Bump fastlane to 2.240.1 to resolve rubyzip advisory by antonis in #6788
  • chore(deps): bump getsentry/craft from 2.31.0 to 2.31.2 by dependabot in #6793
  • chore(deps): bump the codeql-action group with 3 updates by dependabot in #6789
  • chore(deps): bump ruby/setup-ruby from 1.324.0 to 1.327.0 by dependabot in #6790
  • chore(deps): bump getsentry/github-workflows/updater from 3.4.0 to 3.4.1 by dependabot in #6792
  • chore(deps): bump getsentry/github-workflows/danger from 4013fc6e1aeb1be1f9d3b4d232624f0ec1afa613 to 36c729264d2edc29ebae61950c50e1e9f043ad7e by dependabot in #6791
  • chore(deps): update Cocoa SDK to v9.29.2 by github-actions in #6787
  • feat(replay): Populate trace_ids in mobile replay events by antonis in #6786
  • chore(deps): update Cocoa SDK to v9.29.1 by github-actions in #6785
  • chore(deps): update Android SDK to v8.58.0 by github-actions in #6778
  • fix(build): Prevent update-android.sh from failing on SIGPIPE by antonis in #6777
  • chore(deps): update Wizard to v8.0.0 by github-actions in #6775

🤖 This preview updates automatically when you update the PR.

Add a step to the test-android job that compiles the SDK module with
sentry-android-replay excluded (via a Gradle init script), so CI fails fast if
the SDK regains a hard dependency on a non-stubbed replay symbol. This path was
previously never built in CI, letting such a break ship silently.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 a6e5995. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 471.06 ms 511.52 ms 40.46 ms
Size 50.56 MiB 56.51 MiB 5.95 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
5789645+dirty 426.82 ms 495.42 ms 68.60 ms
fa21fca+dirty 453.80 ms 468.46 ms 14.66 ms
a216cb9+dirty 458.66 ms 531.47 ms 72.81 ms
0307fa4+dirty 454.16 ms 518.35 ms 64.18 ms
5569641+dirty 406.43 ms 428.51 ms 22.08 ms
53a3f8e+dirty 451.90 ms 500.02 ms 48.12 ms
6a3eb4c+dirty 430.90 ms 489.98 ms 59.08 ms
5fe1c6c+dirty 401.62 ms 445.28 ms 43.66 ms
a636fa4+dirty 486.70 ms 508.53 ms 21.83 ms
15d4514+dirty 406.77 ms 428.06 ms 21.29 ms

App size

Revision Plain With Sentry Diff
5789645+dirty 49.74 MiB 54.85 MiB 5.11 MiB
fa21fca+dirty 49.74 MiB 55.37 MiB 5.63 MiB
a216cb9+dirty 49.74 MiB 55.08 MiB 5.34 MiB
0307fa4+dirty 49.74 MiB 54.81 MiB 5.07 MiB
5569641+dirty 48.30 MiB 53.48 MiB 5.18 MiB
53a3f8e+dirty 50.56 MiB 56.46 MiB 5.90 MiB
6a3eb4c+dirty 49.74 MiB 55.44 MiB 5.70 MiB
5fe1c6c+dirty 43.75 MiB 48.14 MiB 4.39 MiB
a636fa4+dirty 49.74 MiB 55.36 MiB 5.62 MiB
15d4514+dirty 48.30 MiB 53.60 MiB 5.30 MiB

@sentry

sentry Bot commented Sep 29, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.28.0 (108) Release

⚙️ sentry-react-native Build Distribution Settings

@github-actions

Copy link
Copy Markdown
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3826.82 ms 1217.04 ms -2609.78 ms
Size 5.15 MiB 6.93 MiB 1.78 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
64630e5+dirty 3842.70 ms 1218.11 ms -2624.60 ms
b0d3373+dirty 3831.75 ms 1227.29 ms -2604.46 ms
b04af96+dirty 3818.92 ms 1219.76 ms -2599.16 ms
3d31fcf+dirty 3838.09 ms 1223.46 ms -2614.63 ms
a0a3177+dirty 3844.73 ms 1225.23 ms -2619.51 ms
af33f3b+dirty 3849.98 ms 1236.45 ms -2613.53 ms
09a902f+dirty 3835.67 ms 1217.11 ms -2618.57 ms
5a316ea+dirty 3820.11 ms 1211.28 ms -2608.83 ms
acd838e+dirty 3849.78 ms 1230.00 ms -2619.78 ms
c2e182c+dirty 3848.40 ms 1211.79 ms -2636.61 ms

App size

Revision Plain With Sentry Diff
64630e5+dirty 4.98 MiB 6.46 MiB 1.49 MiB
b0d3373+dirty 5.15 MiB 6.68 MiB 1.53 MiB
b04af96+dirty 4.98 MiB 6.54 MiB 1.56 MiB
3d31fcf+dirty 4.98 MiB 6.56 MiB 1.58 MiB
a0a3177+dirty 4.98 MiB 6.55 MiB 1.58 MiB
af33f3b+dirty 4.98 MiB 6.51 MiB 1.54 MiB
09a902f+dirty 4.98 MiB 6.46 MiB 1.49 MiB
5a316ea+dirty 4.98 MiB 6.51 MiB 1.53 MiB
acd838e+dirty 5.15 MiB 6.70 MiB 1.55 MiB
c2e182c+dirty 4.98 MiB 6.50 MiB 1.52 MiB

@antonis
antonis marked this pull request as ready for review September 29, 2026 15:04
@github-actions

Copy link
Copy Markdown
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 444.98 ms 492.93 ms 47.96 ms
Size 50.56 MiB 56.51 MiB 5.95 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
4e0b819+dirty 599.31 ms 654.31 ms 55.00 ms
5789645+dirty 502.66 ms 594.19 ms 91.53 ms
fa21fca+dirty 455.70 ms 551.22 ms 95.52 ms
a216cb9+dirty 427.72 ms 510.82 ms 83.10 ms
5b7e8a7+dirty 601.58 ms 634.98 ms 33.40 ms
53a3f8e+dirty 422.00 ms 436.96 ms 14.96 ms
6a3eb4c+dirty 525.65 ms 562.32 ms 36.67 ms
9210ae6+dirty 444.14 ms 459.80 ms 15.66 ms
a636fa4+dirty 420.53 ms 452.34 ms 31.81 ms
ae37560+dirty 428.96 ms 456.86 ms 27.90 ms

App size

Revision Plain With Sentry Diff
4e0b819+dirty 49.74 MiB 54.81 MiB 5.07 MiB
5789645+dirty 49.74 MiB 54.85 MiB 5.11 MiB
fa21fca+dirty 49.74 MiB 55.37 MiB 5.63 MiB
a216cb9+dirty 49.74 MiB 55.08 MiB 5.34 MiB
5b7e8a7+dirty 48.30 MiB 53.58 MiB 5.28 MiB
53a3f8e+dirty 50.56 MiB 56.46 MiB 5.90 MiB
6a3eb4c+dirty 49.74 MiB 55.44 MiB 5.70 MiB
9210ae6+dirty 48.30 MiB 53.54 MiB 5.23 MiB
a636fa4+dirty 49.74 MiB 55.36 MiB 5.62 MiB
ae37560+dirty 48.30 MiB 53.60 MiB 5.29 MiB

@github-actions

Copy link
Copy Markdown
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3856.50 ms 1233.91 ms -2622.59 ms
Size 5.15 MiB 6.93 MiB 1.78 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
68ae91b+dirty 3836.36 ms 1222.04 ms -2614.32 ms
0b5a379+dirty 3857.69 ms 1230.34 ms -2627.35 ms
bf168a4+dirty 3846.83 ms 1221.33 ms -2625.49 ms
f170ec3+dirty 3844.74 ms 1222.67 ms -2622.07 ms
68672fc+dirty 3832.22 ms 1228.29 ms -2603.93 ms
84cba31+dirty 3830.40 ms 1204.44 ms -2625.96 ms
2c735cc+dirty 1223.33 ms 1224.38 ms 1.04 ms
b9bebee+dirty 3858.02 ms 1231.92 ms -2626.11 ms
a50b33d+dirty 1207.11 ms 1212.10 ms 5.00 ms
5569641+dirty 3824.35 ms 1210.78 ms -2613.57 ms

App size

Revision Plain With Sentry Diff
68ae91b+dirty 4.98 MiB 6.46 MiB 1.48 MiB
0b5a379+dirty 5.15 MiB 6.70 MiB 1.54 MiB
bf168a4+dirty 4.98 MiB 6.47 MiB 1.49 MiB
f170ec3+dirty 5.15 MiB 6.69 MiB 1.53 MiB
68672fc+dirty 5.15 MiB 6.71 MiB 1.55 MiB
84cba31+dirty 4.98 MiB 6.55 MiB 1.57 MiB
2c735cc+dirty 3.38 MiB 4.74 MiB 1.35 MiB
b9bebee+dirty 5.15 MiB 6.68 MiB 1.53 MiB
a50b33d+dirty 3.38 MiB 4.73 MiB 1.35 MiB
5569641+dirty 5.15 MiB 6.67 MiB 1.51 MiB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android build fails with cannot find symbol ReplayIntegration when sentry-android-replay is excluded

1 participant