From 13b7344fbfaea62803e325518c85d19a1d198297 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Thu, 23 Jul 2026 10:01:09 +0200 Subject: [PATCH 1/2] build(android): Pin AAR minCompileSdk to minSdk AGP 9 changed the default so a published library's AAR metadata minCompileSdk mirrors its compileSdk, which we recently bumped to 37. That would force every consumer of the Android SDK onto compileSdk 37. Pin minCompileSdk to our minSdk for all published Android library modules so consumers stay free to compile against any SDK we support, preserving the pre-AGP-9 behavior. Co-Authored-By: Claude Opus 4.8 --- build.gradle.kts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 764667ecd65..7d8cfcb626e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -177,6 +177,13 @@ subprojects { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } + + // AGP 9 defaults the AAR metadata minCompileSdk to the library's compileSdk, + // which would force every consumer onto that compile SDK. Pin it to our minSdk + // so consumers remain free to compile against any SDK we support, as before. + defaultConfig { + aarMetadata { minCompileSdk = libs.versions.minSdk.get().toInt() } + } } } From 864b750a9ff98812542f9c9387f069601e75d2ae Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Thu, 23 Jul 2026 10:02:11 +0200 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e1561ebfa3..f46c77b306c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Fixes + +- Pin the published Sentry Android SDK's AAR metadata `minCompileSdk` to our `minSdk` (`21`) instead of AGP 9's new default of the SDK's own `compileSdk` (`37`), so apps that depend on the SDK aren't forced to raise their `compileSdk` ([#5823](https://github.com/getsentry/sentry-java/pull/5823)) + ### Performance - Reduce the number of SDK threads: `LifecycleWatcher` now schedules the session-end task on the shared timer executor instead of creating a dedicated `java.util.Timer` thread ([#5819](https://github.com/getsentry/sentry-java/pull/5819))