From e04d3dd3fa8b60d732313935ccaad215acb61f68 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Tue, 21 Jul 2026 14:05:30 +0200 Subject: [PATCH 1/4] build: Bump target and compile SDK to 37 Raise targetSdk and compileSdk from 36 to 37 and remove the temporary GradleDependency lint suppression that was in place only until this bump. API 37 makes MediaCodecInfo.getVideoCapabilities() nullable, so guard the access in SimpleVideoEncoder to keep it compiling. Co-Authored-By: Claude Opus 4.8 --- build.gradle.kts | 14 -------------- gradle/libs.versions.toml | 4 ++-- .../android/replay/video/SimpleVideoEncoder.kt | 2 +- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2e491d2a16c..764667ecd65 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -113,20 +113,6 @@ allprojects { subprojects { apply { plugin("io.sentry.spotless") } - // AGP 9.2 bundles lint 9.2.1, which flags compileSdk 36 as outdated because 37 is available. - // We intentionally stay on compileSdk 36 until the API 37 bump (#5768), so silence that check - // for every Android module (library and application). - pluginManager.withPlugin("com.android.library") { - extensions.configure { - lintOptions { disable("GradleDependency") } - } - } - pluginManager.withPlugin("com.android.application") { - extensions.configure { - lintOptions { disable("GradleDependency") } - } - } - plugins.withId(Config.QualityPlugins.detektPlugin) { configure { buildUponDefaultConfig = true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cdbb4326e9c..89de8fce039 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -47,8 +47,8 @@ springboot4 = "4.1.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 de14aadaaab..04d573d793f 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 308c3d2b300eb74135a4ba9f5d8a0e3d3293ae27 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Tue, 21 Jul 2026 14:06:17 +0200 Subject: [PATCH 2/4] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index df9e9e3c0c2..6ef485736f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ ### Dependencies - The SDK is now compiled with Android Gradle Plugin 9.2.1 ([#5779](https://github.com/getsentry/sentry-java/pull/5779)) +- The SDK is now compiled against Android API 37 ([#5796](https://github.com/getsentry/sentry-java/pull/5796)) ## 8.49.0 From 7cfcb9e587bff0eaa1ad4b09f9c7f7fc980cf8fe Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Tue, 21 Jul 2026 14:08:40 +0200 Subject: [PATCH 3/4] build: Drop obsolete OldTargetApi lint suppression Now that the integration test modules target API 37, lint no longer flags OldTargetApi, so remove the temporary suppression added while they were on 36. Co-Authored-By: Claude Opus 4.8 --- .../sentry-uitest-android-benchmark/build.gradle.kts | 2 -- .../sentry-uitest-android/build.gradle.kts | 2 -- 2 files changed, 4 deletions(-) diff --git a/sentry-android-integration-tests/sentry-uitest-android-benchmark/build.gradle.kts b/sentry-android-integration-tests/sentry-uitest-android-benchmark/build.gradle.kts index 04b5eaf6a23..c3ca2379a76 100644 --- a/sentry-android-integration-tests/sentry-uitest-android-benchmark/build.gradle.kts +++ b/sentry-android-integration-tests/sentry-uitest-android-benchmark/build.gradle.kts @@ -70,8 +70,6 @@ android { lint { warningsAsErrors = true checkDependencies = true - // Suppress OldTargetApi: lint 9.2.1 expects API 37 but we target 36 - disable += "OldTargetApi" // We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks. checkReleaseBuilds = false diff --git a/sentry-android-integration-tests/sentry-uitest-android/build.gradle.kts b/sentry-android-integration-tests/sentry-uitest-android/build.gradle.kts index 6fbba814f83..52c17199e4d 100644 --- a/sentry-android-integration-tests/sentry-uitest-android/build.gradle.kts +++ b/sentry-android-integration-tests/sentry-uitest-android/build.gradle.kts @@ -69,8 +69,6 @@ android { lint { warningsAsErrors = true checkDependencies = true - // Suppress OldTargetApi: lint 9.2.1 expects API 37 but we target 36 - disable += "OldTargetApi" // We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks. checkReleaseBuilds = false From 3c60a1e63cdf0b924fcbc83ab4630a54f1f6b249 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Tue, 21 Jul 2026 14:19:55 +0200 Subject: [PATCH 4/4] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ef485736f9..1596970eb8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ ### Dependencies - The SDK is now compiled with Android Gradle Plugin 9.2.1 ([#5779](https://github.com/getsentry/sentry-java/pull/5779)) -- The SDK is now compiled against Android API 37 ([#5796](https://github.com/getsentry/sentry-java/pull/5796)) +- The SDK has been fully tested for compatibility with Android 17 and platform 37; it is now compiled and tested against it ([#5796](https://github.com/getsentry/sentry-java/pull/5796)) ## 8.49.0