-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
Description
In gradle/libs.versions.toml change:
kotlin = "1.9.22"
to
kotlin = "2.1.0"
... then fix any build error.
Gemini also says to do the following, I am not sure how important it is:
-
While you're in the
[versions]section, you must also update your Compose BOM (Bill of Materials) to a version that's compatible with the new compiler.[versions] kotlin = "2.1.0" # Find your composeBom version and update it. # A version like 2024.05.00 or newer is needed. # Let's try a recent stable one (e.g., from January 2025): androidxComposeBom = "2025.01.00"
-
In the
[plugins]section, you must add the new Compose Compiler plugin, which is now tied to the Kotlin version:[plugins] # You will see your existing plugins here jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } # ... # Add this line: compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
In build.gradle.kts:
-
DELETE the old
composeOptionsblock. For Kotlin 2.0 and newer, this is no longer used.// DELETE THIS ENTIRE BLOCK: composeOptions { kotlinCompilerExtensionVersion = "1.5.8" }
-
ADD the new plugin to your
pluginsblock at the very top of the file:plugins { alias(libs.plugins.android.application) alias(libs.plugins.jetbrains.kotlin.android) alias(libs.plugins.kotlin.kapt) alias(libs.plugins.kotlin.parcelize) alias(libs.plugins.compose.compiler) // <-- ADD THIS LINE }