Repository navigation
Conversation
Compose 1.13 requires compileSdk 37.1, but apps generated by skip init set compileSdk = libs.versions.android.sdk.compile.get().toInt(), which can't express a minor API level. When the version catalog has an android-sdk-compilePlatform entry like "37.1" (to be added by skip-unit), skip-build-plugin uses androidComponents.finalizeDsl to set compileSdkMinor on apps whose compileSdk equals that platform's major level and that haven't set a minor level themselves. An explicit compileSdkMinor = 0 opts out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #776 (for #775, the Compose 1.13 bump). Companion PR: skiptools/skip-unit#30 (draft until this is released).
Compose 1.13 (BOM 2026.12.00) requires
compileSdk37.1. Its AAR metadata, and that of every module built against it, makescheckDebugAarMetadatafail for any app that compiles against plain 37:Library modules get their
compileSdkfrom skip-unit'sskip.yml, and the companion PR changes that there. But every existing app'sAndroid/app/build.gradle.kts, as generated byskip init, contains:compileSdk = libs.versions.android.sdk.compile.get().toInt()An integer can't express 37.1. And assigning
compileSdkresetscompileSdkMinor, so apps would have to edit their build scripts by hand.This PR makes skip-build-plugin fill in the minor level instead:
libsversion catalog has anandroid-sdk-compilePlatformversion with a minor level (skip-unit adds"37.1"), the plugin registers anandroidComponents.finalizeDslaction.finalizeDslruns after the app'sandroid { }block has been evaluated. If the app'scompileSdkequals the catalog's major level and the app hasn't setcompileSdkMinor, the action setscompileSdkMinorto the catalog's minor level, so 37 becomes 37.1.compileSdk { version = release(37) { minorApiLevel = 1 } }is unchanged.compileSdk = 36) is unchanged, and AGP reports its usual error if a dependency needs more.compileSdkMinor = 0explicitly opts out.android-sdk-compilePlatformentry, so this is a no-op.This needs to be released before the skip-unit PR is merged. Once library modules compile against 37.1, AGP requires apps to do the same, even on the current Compose BOM. I checked with the skip-unit change, BOM 2026.05.01 and the released skip 1.9.23:
checkDebugAarMetadatafails for all 19 of the showcase's Skip modules. With this plugin, it passes.The plugin logs
Skip: raising compileSdk from 37 to 37.1at info level when it applies.Alternatives considered
app/build.gradle.kts. Simpler, but it breaks every existing app on upgrade.skip inittemplate to the block form. We should probably do this too, but it only helps new apps.Testing
I used
swift package editon skipapp-showcase with this branch, the skip-unit branch, and skip-model on BOM 2026.12.00 (Compose 1.13.1, material3 1.5.0, material3-adaptive 1.3.0). The app'sbuild.gradle.ktswas left unmodified.gradle :app:checkDebugAarMetadata :app:assembleDebugpasses and compiles the app against android-37.1. Without this change,checkDebugAarMetadatafails.skipplugin plus Gradle) succeeds.android { }block: block-form 37.1,compileSdk = 36, andcompileSdkMinor = 0.swift teston Compose 1.13.1 matches the baseline on released dependencies (compileSdk 37.0):TextTestssize tests fail on the baseline too.Notes
compileSdkMinor, which needs AGP 8.12 or later. The companion skip-unit PR moves the catalog to AGP 9.3.3, the minimum Google lists for 37.1. An app that pins an older AGP in its own catalog while picking up the new skip-unit would fail here.withGroovyBuilderso skip-build-plugin doesn't need a compile-time dependency on AGP.