fix(android): opt out of AGP 9 built-in Kotlin — KSP incompatible

AGP 9 enables built-in Kotlin by default (`android.builtInKotlin=true`),
which we initially adopted by dropping the `kotlin-android` plugin
alias. But KSP isn't compatible with built-in Kotlin yet — Gradle
errors out with:

  > KSP is not compatible with Android Gradle Plugin's built-in Kotlin.
  > Please disable by adding android.builtInKotlin=false to gradle.properties
  > and apply kotlin("android") plugin

Restored the explicit kotlin-android plugin (root + :app) and added
`android.builtInKotlin=false` to gradle.properties. Revisit when KSP
gains built-in-Kotlin support.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-21 22:57:49 -04:00
parent 6dae4b452f
commit 4071894217
3 changed files with 14 additions and 8 deletions
+4 -4
View File
@@ -1,9 +1,9 @@
plugins {
alias(libs.plugins.android.application)
// kotlin-android removed: AGP 9.0+ auto-enables Kotlin via the
// android.builtInKotlin=true default. The serialization + compose-compiler
// plugins still need explicit application because they're language-level
// (Kotlin compiler) plugins beyond what built-in Kotlin provides.
// kotlin-android applied explicitly: AGP 9's built-in Kotlin path is
// not compatible with KSP yet. Opted out via
// android.builtInKotlin=false in gradle.properties.
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.ksp)
+4 -4
View File
@@ -1,9 +1,9 @@
plugins {
alias(libs.plugins.android.application) apply false
// kotlin-android plugin no longer needed: AGP 9.0+ auto-enables via
// android.builtInKotlin=true (default). Kept the serialization +
// compose-compiler plugins, which are language-level (Kotlin compiler)
// plugins still applied explicitly per module.
// 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
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.hilt) apply false
+6
View File
@@ -4,4 +4,10 @@ org.gradle.caching=true
org.gradle.configuration-cache=true
android.useAndroidX=true
android.nonTransitiveRClass=true
# KSP isn't compatible with AGP 9's built-in Kotlin support (the
# `android.builtInKotlin=true` default). Opt out so we can apply the
# explicit kotlin-android plugin and KSP together. Revisit when KSP
# adds built-in-Kotlin support.
android.builtInKotlin=false
kotlin.code.style=official