Skip to content

fix(android): Resolve @sentry/react-native from rootDir in Expo plugin - #6840

Open
alwx wants to merge 3 commits into
mainfrom
alwx/bugfix/6828
Open

alwx wants to merge 3 commits into
mainfrom
alwx/bugfix/6828

Conversation

@alwx

@alwx alwx commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix

📜 Description

The Expo plugin now writes .execute(null, rootDir) in the apply from: line of android/app/build.gradle. If the file already has the old bare .execute() line, the plugin replaces it on the next prebuild.

💡 Motivation and Context

Without a working directory, node resolves @sentry/react-native from the directory where Gradle started. If you run gradlew -p from a different directory, the build fails or applies a different SDK version without a warning.

Fixes #6828

💚 How did you test it?

I added unit tests for the new line and for the migration of the old line, also with disableAutoUpload and the old sentry.gradle name. yarn lint, yarn test, and yarn circularDepCheck pass.

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • All tests passing.
  • No breaking changes.

🔮 Next steps

sentry-wizard writes the same bare .execute() line in src/react-native/gradle.ts, and it needs a separate fix.

🤖 Generated with Claude Code

alwx and others added 2 commits October 5, 2026 11:38
The Expo plugin added a node call without a working directory to
app/build.gradle. Node then resolved the package from the directory
where Gradle started. The plugin now uses rootDir and migrates the
existing line on the next prebuild.

Fixes #6828

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 5, 2026 •

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): Resolve @sentry/react-native from rootDir in Expo plugin by alwx in #6840
  • chore(expo): bump sample to Expo 57.0.26 by antonis in #6838
  • chore(deps): Bump basic-ftp to 6.2.2 by alwx in #6837
  • fix(core): Mark package as side-effect free by devclaimjuimperai in #6829
  • chore(deps): bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.31.0 to 2.33.1 by dependabot in #6833
  • chore(deps): bump gradle/actions/setup-gradle from 6.3.0 to 6.4.0 by dependabot in #6834
  • chore(deps): bump getsentry/craft from 2.31.2 to 2.33.1 by dependabot in #6835
  • chore(deps): bump getsentry/github-workflows/validate-pr from 4013fc6e1aeb1be1f9d3b4d232624f0ec1afa613 to 36c729264d2edc29ebae61950c50e1e9f043ad7e by dependabot in #6832
  • fix(android): Settle initNativeReactNavigationNewFrameTracking promise by antonis in #6823
  • fix(spotlight): Forward image attachments to Spotlight by antonis in #6818
  • fix(ios): Prevent crash when initialized with an invalid DSN by antonis in #6825
  • chore(core): Resolve non-actionable TODOs by antonis in #6826
  • chore(core): resolve stale TODO comments by antonis in #6819
  • fix(profiling): Populate Hermes runtime version on JS profiles by antonis in #6817

🤖 This preview updates automatically when you update the PR.

@alwx
alwx marked this pull request as ready for review October 5, 2026 09:51
@antonis antonis added the ready-to-merge Triggers the full CI test suite label Oct 5, 2026
@sentry

sentry Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-react-native Build Distribution Settings

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3850.04 ms 1229.87 ms -2620.17 ms
Size 5.15 MiB 6.94 MiB 1.79 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
7a89652+dirty 3861.46 ms 1229.61 ms -2631.85 ms
0b1b5e3+dirty 3823.96 ms 1220.12 ms -2603.84 ms
3e3142c+dirty 3867.38 ms 1232.48 ms -2634.90 ms
9210ae6+dirty 3815.93 ms 1214.14 ms -2601.79 ms
6177334+dirty 3834.85 ms 1217.58 ms -2617.28 ms
3a829f0+dirty 3839.76 ms 1214.69 ms -2625.06 ms
2cac31b+dirty 3886.27 ms 1230.85 ms -2655.42 ms
a5d243c+dirty 3842.35 ms 1214.29 ms -2628.06 ms
244f6e8+dirty 3833.36 ms 1212.96 ms -2620.41 ms
a3265b6+dirty 3826.31 ms 1207.87 ms -2618.44 ms

App size

Revision Plain With Sentry Diff
7a89652+dirty 5.15 MiB 6.70 MiB 1.55 MiB
0b1b5e3+dirty 5.15 MiB 6.70 MiB 1.54 MiB
3e3142c+dirty 4.98 MiB 6.56 MiB 1.58 MiB
9210ae6+dirty 5.15 MiB 6.68 MiB 1.53 MiB
6177334+dirty 5.15 MiB 6.68 MiB 1.53 MiB
3a829f0+dirty 5.15 MiB 6.70 MiB 1.54 MiB
2cac31b+dirty 4.98 MiB 6.55 MiB 1.58 MiB
a5d243c+dirty 5.15 MiB 6.68 MiB 1.53 MiB
244f6e8+dirty 4.98 MiB 6.56 MiB 1.58 MiB
a3265b6+dirty 5.15 MiB 6.68 MiB 1.53 MiB

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 485.88 ms 578.72 ms 92.84 ms
Size 50.56 MiB 56.59 MiB 6.03 MiB

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3854.50 ms 1225.04 ms -2629.46 ms
Size 5.15 MiB 6.94 MiB 1.79 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
64630e5+dirty 3845.49 ms 1215.19 ms -2630.30 ms
b0d3373+dirty 3842.49 ms 1218.49 ms -2624.00 ms
b04af96+dirty 3830.54 ms 1206.11 ms -2624.44 ms
f9c1ed4+dirty 3842.09 ms 1220.70 ms -2621.40 ms
09a902f+dirty 3847.65 ms 1221.31 ms -2626.34 ms
44abcc2+dirty 3841.42 ms 1214.77 ms -2626.65 ms
acd838e+dirty 3835.94 ms 1215.87 ms -2620.07 ms
bfba737+dirty 3834.18 ms 1222.80 ms -2611.38 ms
ce7b368+dirty 3851.41 ms 1222.37 ms -2629.04 ms
4e0ba9c+dirty 3856.39 ms 1234.44 ms -2621.95 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
f9c1ed4+dirty 4.98 MiB 6.50 MiB 1.53 MiB
09a902f+dirty 4.98 MiB 6.46 MiB 1.49 MiB
44abcc2+dirty 4.98 MiB 6.55 MiB 1.57 MiB
acd838e+dirty 5.15 MiB 6.70 MiB 1.55 MiB
bfba737+dirty 4.98 MiB 6.51 MiB 1.53 MiB
ce7b368+dirty 4.98 MiB 6.51 MiB 1.53 MiB
4e0ba9c+dirty 5.15 MiB 6.67 MiB 1.51 MiB

@antonis antonis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 🚀

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 492.80 ms 559.51 ms 66.71 ms
Size 50.56 MiB 56.59 MiB 6.03 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

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.

Expo plugin's apply from: line resolves @sentry/react-native from the directory Gradle was started in, not from the project

2 participants