Skip to content

Commit 4670d89

Browse files
runningcodeclaude
andauthored
build(android): Pin AAR minCompileSdk to minSdk (#5823)
* 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 <noreply@anthropic.com> * changelog --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 023ef00 commit 4670d89

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Fixes
6+
7+
- 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))
8+
59
### Performance
610

711
- 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))

build.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,13 @@ subprojects {
177177
sourceCompatibility = JavaVersion.VERSION_1_8
178178
targetCompatibility = JavaVersion.VERSION_1_8
179179
}
180+
181+
// AGP 9 defaults the AAR metadata minCompileSdk to the library's compileSdk,
182+
// which would force every consumer onto that compile SDK. Pin it to our minSdk
183+
// so consumers remain free to compile against any SDK we support, as before.
184+
defaultConfig {
185+
aarMetadata { minCompileSdk = libs.versions.minSdk.get().toInt() }
186+
}
180187
}
181188
}
182189

0 commit comments

Comments
 (0)