Skip to content

fix(android): Use safeExtGet for compileSdkVersion in expo-handler#6061

Merged
lucas-zimerman merged 4 commits intomainfrom
lz/6054
Apr 28, 2026
Merged

fix(android): Use safeExtGet for compileSdkVersion in expo-handler#6061
lucas-zimerman merged 4 commits intomainfrom
lz/6054

Conversation

@lucas-zimerman
Copy link
Copy Markdown
Collaborator

📢 Type of change

  • Bugfix

📜 Description

Add safeExtGet helper to expo-handler/build.gradle and use it for compileSdkVersion and minSdkVersion instead of hardcoded values, matching the pattern already used in the main build.gradle.

💡 Motivation and Context

When a user only has a newer Android SDK installed (e.g. SDK 36) and not SDK 31, the build fails with:

Failed to find target with hash string 'android-31' in: /Users/<user>/Library/Android/sdk

This happens because expo-handler/build.gradle hardcodes compileSdkVersion 31, while the main build.gradle already uses safeExtGet('compileSdkVersion', 31) to inherit the value from the root project. The fix brings expo-handler in line with the same pattern.

Fixes #6054

💚 How did you test it?

Code review — the change is a mechanical port of the existing safeExtGet pattern from packages/core/android/build.gradle into packages/core/android/expo-handler/build.gradle.

📝 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
  • No breaking changes

🔮 Next steps

lucas-zimerman and others added 3 commits April 28, 2026 13:40
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lucas-zimerman lucas-zimerman marked this pull request as ready for review April 28, 2026 12:43
Copy link
Copy Markdown
Contributor

@antonis antonis left a comment

Choose a reason for hiding this comment

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

LGTM 🎸

@lucas-zimerman lucas-zimerman added the ready-to-merge Triggers the full CI test suite label Apr 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 501.73 ms 548.56 ms 46.83 ms
Size 43.75 MiB 48.15 MiB 4.40 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
4953e94+dirty 442.02 ms 456.52 ms 14.50 ms
2c735cc+dirty 414.09 ms 438.47 ms 24.38 ms
df5d108+dirty 527.06 ms 603.58 ms 76.52 ms
3ce5254+dirty 410.57 ms 448.48 ms 37.91 ms
3d377b5+dirty 406.18 ms 453.52 ms 47.34 ms
0d9949d+dirty 403.57 ms 437.00 ms 33.43 ms
4b87b12+dirty 421.82 ms 413.60 ms -8.22 ms
7ac3378+dirty 404.78 ms 439.84 ms 35.06 ms
890d145+dirty 504.54 ms 491.55 ms -12.99 ms
3817909+dirty 406.67 ms 416.58 ms 9.91 ms

App size

Revision Plain With Sentry Diff
4953e94+dirty 43.75 MiB 48.08 MiB 4.33 MiB
2c735cc+dirty 43.75 MiB 48.08 MiB 4.33 MiB
df5d108+dirty 43.75 MiB 48.08 MiB 4.33 MiB
3ce5254+dirty 43.75 MiB 48.12 MiB 4.37 MiB
3d377b5+dirty 43.75 MiB 48.14 MiB 4.39 MiB
0d9949d+dirty 43.75 MiB 48.13 MiB 4.37 MiB
4b87b12+dirty 43.75 MiB 48.14 MiB 4.39 MiB
7ac3378+dirty 43.75 MiB 48.13 MiB 4.37 MiB
890d145+dirty 43.75 MiB 48.14 MiB 4.39 MiB
3817909+dirty 43.75 MiB 48.08 MiB 4.33 MiB

@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 28, 2026

📲 Install Builds

Android

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

⚙️ sentry-react-native Build Distribution Settings

@lucas-zimerman lucas-zimerman enabled auto-merge (squash) April 28, 2026 16:55
@lucas-zimerman lucas-zimerman merged commit 5a3a639 into main Apr 28, 2026
53 of 73 checks passed
@lucas-zimerman lucas-zimerman deleted the lz/6054 branch April 28, 2026 16:59
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.

Sentry won't compile if SDK Tools 31 are not installed

2 participants