chore(android): bump Kotlin 2.2 -> 2.3 + KSP 2.0 -> 2.3 for AGP 9 built-in Kotlin
The previous attempt opted out of AGP 9's built-in Kotlin (via
android.builtInKotlin=false + explicit kotlin-android plugin) because
the message from Gradle suggested it. But Kotlin 2.2.21's
kotlin-android plugin can't cast AGP 9's new ApplicationExtension to
the removed BaseExtension:
class ApplicationExtensionImpl$AgpDecorated_Decorated
cannot be cast to class com.android.build.gradle.BaseExtension
That suggestion is for projects with an older Kotlin toolchain. The
real fix:
- Kotlin 2.3.21 (latest stable; first line where kotlin-android also
supports AGP 9, but more importantly the built-in path works)
- KSP 2.3.8 — KSP PR #2674 (merged Oct 2025) added AGP 9 built-in
Kotlin support. KSP 1.x and pre-2.3 don't work with built-in Kotlin.
- Re-drop the kotlin-android plugin from both build.gradle.kts files;
AGP 9 enables built-in Kotlin by default and KSP 2.3 cooperates.
- Remove android.builtInKotlin=false from gradle.properties.
compose-compiler plugin tracks the Kotlin version via version.ref, so
no separate bump there.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.application) apply false
|
||||
// kotlin-android needed despite AGP 9's built-in Kotlin: KSP isn't
|
||||
// compatible with the builtInKotlin path yet, so we opt out via
|
||||
// android.builtInKotlin=false in gradle.properties.
|
||||
alias(libs.plugins.kotlin.android) apply false
|
||||
// kotlin-android NOT registered: AGP 9 built-in Kotlin + KSP 2.3.x
|
||||
// covers the Kotlin compilation path. Language-level Kotlin compiler
|
||||
// plugins (serialization, compose-compiler) are still applied
|
||||
// explicitly per module.
|
||||
alias(libs.plugins.kotlin.serialization) apply false
|
||||
alias(libs.plugins.ksp) apply false
|
||||
alias(libs.plugins.hilt) apply false
|
||||
|
||||
Reference in New Issue
Block a user