From f9c189861f0b187292ade1207a1994a7aae4a602 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Mon, 6 Jul 2026 14:23:17 +0200 Subject: [PATCH 1/3] feat(android): Compile against Android SDK 37 Bump compileSdk and targetSdk to 37 (Android 17). Also handle the now-nullable MediaCodecInfo.getVideoCapabilities() in SimpleVideoEncoder: the API 37 android.jar annotates it @Nullable, which otherwise fails Kotlin compilation. The access is already inside a try/catch, so behavior is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) --- gradle/libs.versions.toml | 4 ++-- .../java/io/sentry/android/replay/video/SimpleVideoEncoder.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1a145040e7..1496545b10 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -45,8 +45,8 @@ springboot4 = "4.0.0" sqldelight = "2.3.2" # Android -targetSdk = "36" -compileSdk = "36" +targetSdk = "37" +compileSdk = "37" minSdk = "21" [plugins] diff --git a/sentry-android-replay/src/main/java/io/sentry/android/replay/video/SimpleVideoEncoder.kt b/sentry-android-replay/src/main/java/io/sentry/android/replay/video/SimpleVideoEncoder.kt index de14aadaaa..04d573d793 100644 --- a/sentry-android-replay/src/main/java/io/sentry/android/replay/video/SimpleVideoEncoder.kt +++ b/sentry-android-replay/src/main/java/io/sentry/android/replay/video/SimpleVideoEncoder.kt @@ -81,7 +81,7 @@ internal class SimpleVideoEncoder( val videoCapabilities = mediaCodec.codecInfo.getCapabilitiesForType(muxerConfig.mimeType).videoCapabilities - if (!videoCapabilities.bitrateRange.contains(bitRate)) { + if (videoCapabilities != null && !videoCapabilities.bitrateRange.contains(bitRate)) { options.logger.log( DEBUG, "Encoder doesn't support the provided bitRate: $bitRate, the value will be clamped to the closest one", From 1d49f255c68c638130677922ac068d39cb4a59d1 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Mon, 6 Jul 2026 14:24:44 +0200 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24df41730a..aed0cfec67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ Sentry.finishExtendedAppStart() ``` +- Full support for Android 17 (API level 37) ([#5723](https://github.com/getsentry/sentry-java/pull/5723)) + - The SDK is now compiled and targeted against `compileSdk`/`targetSdk` 37 and verified end-to-end on API 37: builds (incl. R8 full mode), Session Replay, crash & ANR reporting (JVM and native), and profiling + - Session Replay video encoding now handles the `@Nullable` `MediaCodecInfo.getVideoCapabilities()` introduced in the API 37 SDK - Add `trace_metric_byte` data category and record byte-level client reports when trace metrics are discarded ([#5626](https://github.com/getsentry/sentry-java/pull/5626)) - Support the `io.sentry.tombstone.report-historical` manifest option to enable historical tombstone reporting via `AndroidManifest.xml` `` ([#5683](https://github.com/getsentry/sentry-java/pull/5683)) From e007f1c45783788c37caeac1592ab65fdfcd6610 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Wed, 8 Jul 2026 09:11:09 +0200 Subject: [PATCH 3/3] build(android): Install android-37.0 platform for AGP matrix API 37 ships as a minor-versioned platform (android-37.0). Install it explicitly in the AGP compatibility matrix before building the release APK so the platform can be resolved. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/agp-matrix.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/agp-matrix.yml b/.github/workflows/agp-matrix.yml index 1d2a3bbb56..edf88d2e68 100644 --- a/.github/workflows/agp-matrix.yml +++ b/.github/workflows/agp-matrix.yml @@ -73,6 +73,11 @@ jobs: disk-size: 4096M script: echo "Generated AVD snapshot for caching." + # API 37 ships as a minor-versioned platform (android-37.0); install it + # explicitly so the build can resolve it. + - name: Install compileSdk platform + run: echo "y" | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "platforms;android-37.0" + # Clean, build and release a test apk - name: Make assembleUiTests run: make assembleUiTests