Skip to content

Commit 13b7344

Browse files
runningcodeclaude
andcommitted
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>
1 parent 023ef00 commit 13b7344

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

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)