Skip to content

Commit 5a3a639

Browse files
fix(android): Use safeExtGet for compileSdkVersion in expo-handler (#6061)
* fix(android): Use safeExtGet for compileSdkVersion in expo-handler Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * meta: Add changelog entry for expo-handler compileSdkVersion fix Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Changelog --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ca37dc6 commit 5a3a639

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
### Fixes
1717

18+
- Android build failure in `expo-handler` when Android SDK 31 is not installed by using `safeExtGet` for `compileSdkVersion` and `minSdkVersion` ([#6061](https://github.com/getsentry/sentry-react-native/pull/6061))
1819
- Stop the Hermes sampling profiler on React instance teardown to prevent `pthread_kill` SIGABRT when the JS thread is torn down with profiling active ([#6035](https://github.com/getsentry/sentry-react-native/pull/6035))
1920
- Restrict the URI scope of `getDataFromUri` on iOS and Android ([#6045](https://github.com/getsentry/sentry-react-native/pull/6045))
2021
- Restrict the Metro source-context middleware to files within the project root ([#6044](https://github.com/getsentry/sentry-react-native/pull/6044))

packages/core/android/expo-handler/build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
def safeExtGet(prop, fallback) {
2+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
3+
}
4+
15
apply plugin: 'com.android.library'
26

37
android {
4-
compileSdkVersion 31
8+
compileSdkVersion safeExtGet('compileSdkVersion', 31)
59
namespace = "io.sentry.react.expo"
610

711
defaultConfig {
8-
minSdkVersion 21
12+
minSdkVersion safeExtGet('minSdkVersion', 21)
913
}
1014

1115
compileOptions {

0 commit comments

Comments
 (0)