When upgrading Kotlin or Jetpack Compose in an Android project, the build can fail with a Kotlin and Compose Compiler compatibility error.
This version of the Compose Compiler requires Kotlin version ...
The Compose Compiler requires Kotlin ...
Incompatible version of Kotlin
Compose Compiler is not compatible with this version of Kotlin
Older Compose projects managed the Kotlin version and kotlinCompilerExtensionVersion separately. Updating only one of them could therefore create an incompatible compiler combination.
The modern setup is different. For Kotlin 2.0 and later, Jetpack Compose uses the org.jetbrains.kotlin.plugin.compose Compose Compiler Gradle plugin, and its version is aligned with the Kotlin version. Google’s current Android documentation states that this plugin is available for Kotlin 2.0+ and demonstrates using the same version reference for Kotlin and the Compose compiler plugin. :contentReference[oaicite:17]{index=17}
This article explains how to diagnose and fix Compose/Kotlin compatibility errors in both modern Kotlin 2.x projects and older Kotlin 1.x projects.
- What Is a Compose/Kotlin Compatibility Error?
- Common Situations
- Step 1: Find the Kotlin Version
- Use the Compose Compiler Plugin with Kotlin 2.0+
- Solution 1: Apply the Compose Compiler Plugin on Kotlin 2.x
- Solution 2: Apply the Plugin Without a Version Catalog
- Cause 1: Kotlin 2.x Is Still Using the Old composeOptions Model
- Solution 3: Use the Modern Compiler Plugin
- Cause 2: Kotlin 1.x Uses an Incompatible Compose Compiler
- Solution 4: Use a Matching Compiler in Kotlin 1.x
- Cause 3: Only Kotlin Was Updated
- Solution 5: Review Kotlin and the Old Compiler Together
- Cause 4: Assuming the Compose BOM Controls the Compiler
- Solution 6: Configure the BOM and Compiler Separately
- Cause 5: Compose Is Not Enabled
- Solution 7: Enable Compose
- Cause 6: The Version Catalog Uses Different Plugin Versions
- Solution 8: Share the Kotlin Version Reference
- Cause 7: Only Some Modules Were Migrated
- Solution 9: Inspect Every Compose Module
- Cause 8: An Old Compose Compiler Artifact Is Still Added Manually
- Solution 10: Remove Old Compiler Configuration on Kotlin 2.x
- Cause 9: Old and New Tutorials Were Mixed Together
- Solution 11: Standardize the Build Setup
- Cause 10: Suppressing the Compatibility Check
- Step 1: Search for the Kotlin Version
- Step 2: Search for the Compose Compiler Configuration
- Step 3: Check Applied Plugins
- Step 4: Run Gradle Sync
- Step 5: Build from the Command Line
- Solution 12: Inspect Dependencies
- Solution 13: Use the Compose BOM
- Solution 14: Upgrade Large Legacy Projects in Stages
- Solution 15: Clean and Rebuild
- Solution 16: Search for Legacy Compiler Options
- Solution 17: Keep Plugin Versions in One Place
- Modern Configuration Example
- Legacy Kotlin 1.x Example
- If You See “Compose Compiler requires Kotlin…”
- If You See “Kotlin version is not supported”
- If the Project Uses KSP
- Will Updating Android Studio Fix It?
- Should You Clear Caches?
- Kotlin 2.x Migration Checklist
- Kotlin 1.x Checklist
- Fastest Troubleshooting Order
- If the Error Still Occurs
- Summary
What Is a Compose/Kotlin Compatibility Error?
Jetpack Compose requires compiler support to transform @Composable functions.
In older Compose versions, the Compose Compiler was released separately and targeted particular Kotlin compiler versions.
For example:
plugins { id("org.jetbrains.kotlin.android") version "1.9.25" }
android {
composeOptions {
kotlinCompilerExtensionVersion =
"1.5.15"
}
}
Compose Compiler 1.5.15 was released targeting Kotlin 1.9.25, according to Google’s official Compose Compiler release notes. :contentReference[oaicite:18]{index=18}
Using an incompatible Kotlin version with that compiler could therefore cause the build to fail.
Important: First determine whether the project uses the modern Kotlin 2.x Compose Compiler plugin or the older Kotlin 1.x kotlinCompilerExtensionVersion model.
Common Situations
- Updating Kotlin without updating the old Compose Compiler
- Updating the old Compose Compiler without updating Kotlin
- Opening an old Compose project in a new Android Studio version
- Migrating from Kotlin 1.9 to Kotlin 2.x
- Leaving an old
kotlinCompilerExtensionVersionsetting in the project - Updating to Kotlin 2.x without adding the Compose Compiler Gradle plugin
- Changing only the Kotlin version in a Version Catalog
- Using inconsistent settings across multiple modules
- Copying Gradle configuration from an old tutorial
- Confusing the Compose BOM with the Compose Compiler version
Step 1: Find the Kotlin Version
With a Version Catalog:
[versions] kotlin = "2.3.21"
Or in a root Gradle file:
plugins { id("org.jetbrains.kotlin.android") version "2.3.21" apply false }
An older project may instead use:
plugins { id("org.jetbrains.kotlin.android") version "1.9.25" apply false }
Use the Compose Compiler Plugin with Kotlin 2.0+
This is the most important change in modern Compose builds.
Google’s current documentation says that the Compose Compiler Gradle plugin is available starting with Kotlin 2.0 and shows it using the same version reference as Kotlin. :contentReference[oaicite:19]{index=19}
For example:
[versions] kotlin = "2.3.21"
[plugins]
kotlin-android = {
id = "org.jetbrains.kotlin.android",
version.ref = "kotlin"
}
compose-compiler = {
id = "org.jetbrains.kotlin.plugin.compose",
version.ref = "kotlin"
}
Both plugins therefore share the same Kotlin version.
Solution 1: Apply the Compose Compiler Plugin on Kotlin 2.x
Root build.gradle.kts:
plugins { alias( libs.plugins.android.application ) apply false
alias(
libs.plugins.kotlin.android
) apply false
alias(
libs.plugins.compose.compiler
) apply false
}
App module:
plugins { alias( libs.plugins.android.application )
alias(
libs.plugins.kotlin.android
)
alias(
libs.plugins.compose.compiler
)
}
This is the setup pattern documented by Google for Kotlin 2.x Compose projects. :contentReference[oaicite:20]{index=20}
Solution 2: Apply the Plugin Without a Version Catalog
plugins { id("com.android.application") id("org.jetbrains.kotlin.android") id("org.jetbrains.kotlin.plugin.compose") }
If versions are declared in the root build:
plugins { id("org.jetbrains.kotlin.android") version "2.3.21" apply false
id("org.jetbrains.kotlin.plugin.compose")
version "2.3.21"
apply false
}
Keep the two versions aligned.
Cause 1: Kotlin 2.x Is Still Using the Old composeOptions Model
Older projects commonly contain:
android { composeOptions { kotlinCompilerExtensionVersion = "1.5.15" } }
Keeping the old compiler-selection model while migrating to Kotlin 2.x can make the build configuration confusing or incorrect.
Solution 3: Use the Modern Compiler Plugin
With Kotlin 2.x, use:
plugins { id("org.jetbrains.kotlin.plugin.compose") }
If compiler-specific configuration is required, the modern plugin provides the composeCompiler block. Google’s current documentation demonstrates this configuration model. :contentReference[oaicite:21]{index=21}
composeCompiler { reportsDestination = layout.buildDirectory.dir( "compose_compiler" ) }
Do not: Blindly copy kotlinCompilerExtensionVersion from an old tutorial into a modern Kotlin 2.x project.
Cause 2: Kotlin 1.x Uses an Incompatible Compose Compiler
With the older compiler model, the Kotlin and Compose Compiler versions need to be compatible.
For example:
Kotlin 1.9.25 + Compose Compiler 1.5.15
is a documented pairing because Compose Compiler 1.5.15 targeted Kotlin 1.9.25. :contentReference[oaicite:22]{index=22}
Solution 4: Use a Matching Compiler in Kotlin 1.x
plugins { id("org.jetbrains.kotlin.android") version "1.9.25" }
android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion =
"1.5.15"
}
}
Google’s Compose Compiler release notes confirm that version 1.5.15 targets Kotlin 1.9.25. :contentReference[oaicite:23]{index=23}
Cause 3: Only Kotlin Was Updated
In an older project, changing:
Kotlin 1.9.24 ↓ 1.9.25
without reviewing the Compose Compiler can create an incompatible pairing.
Solution 5: Review Kotlin and the Old Compiler Together
Check both:
Kotlin plugin version
kotlinCompilerExtensionVersion
Do not assume that an arbitrary combination will work.
Cause 4: Assuming the Compose BOM Controls the Compiler
The Compose BOM manages compatible versions of Compose libraries such as Runtime, UI, Foundation, and Material.
The Compose Compiler plugin serves a different purpose.
Google’s current setup page lists Compose BOM 2026.08.00, while the Compose Compiler plugin follows the Kotlin version. :contentReference[oaicite:24]{index=24}
Compose BOM → Aligns Compose library versions
Compose Compiler Plugin
→ Integrates Compose with the Kotlin compiler
Solution 6: Configure the BOM and Compiler Separately
plugins { alias( libs.plugins.compose.compiler ) }
android {
buildFeatures {
compose = true
}
}
dependencies {
val composeBom =
platform(
"androidx.compose:compose-bom:2026.08.00"
)
implementation(composeBom)
implementation(
"androidx.compose.material3:material3"
)
}
The BOM version does not need to numerically match the Kotlin version.
Cause 5: Compose Is Not Enabled
Even with compatible compiler versions, the Android module needs Compose enabled.
android { buildFeatures { compose = true } }
Google’s current setup documentation still requires Compose to be enabled through Android build features. :contentReference[oaicite:25]{index=25}
Solution 7: Enable Compose
Kotlin DSL:
android { buildFeatures { compose = true } }
Groovy:
android { buildFeatures { compose true } }
Cause 6: The Version Catalog Uses Different Plugin Versions
A problematic configuration might be:
[versions] kotlin = "2.3.21" composeCompiler = "2.1.0"
[plugins]
kotlin-android = {
id = "org.jetbrains.kotlin.android",
version.ref = "kotlin"
}
compose-compiler = {
id = "org.jetbrains.kotlin.plugin.compose",
version.ref = "composeCompiler"
}
Solution 8: Share the Kotlin Version Reference
[versions] kotlin = "2.3.21"
[plugins]
kotlin-android = {
id = "org.jetbrains.kotlin.android",
version.ref = "kotlin"
}
compose-compiler = {
id = "org.jetbrains.kotlin.plugin.compose",
version.ref = "kotlin"
}
This is the configuration shown in Google’s current documentation. :contentReference[oaicite:26]{index=26}
Cause 7: Only Some Modules Were Migrated
A multi-module project may contain:
:app :feature-home :feature-settings :design-system
If :app uses the new Kotlin 2.x plugin model but another Compose module still contains old compiler settings, the build can fail.
Solution 9: Inspect Every Compose Module
For every module that uses Compose, verify:
- The Compose Compiler plugin is applied when required.
- Compose is enabled.
- No obsolete compiler option remains.
- The module is not declaring its own incompatible Kotlin version.
Cause 8: An Old Compose Compiler Artifact Is Still Added Manually
A Kotlin 2.x project may still contain an old dependency or configuration referring to:
androidx.compose.compiler:compiler:1.5.15
Modern Kotlin 2.x projects should use the Kotlin Compose plugin instead.
Solution 10: Remove Old Compiler Configuration on Kotlin 2.x
Use:
id("org.jetbrains.kotlin.plugin.compose")
and remove obsolete manual compiler declarations that are no longer part of the modern build setup.
Cause 9: Old and New Tutorials Were Mixed Together
Older Compose projects may contain:
composeOptions { kotlinCompilerExtensionVersion = "..." }
while modern examples contain:
id("org.jetbrains.kotlin.plugin.compose")
Mixing configuration generations without understanding which one applies to your Kotlin version can create compatibility problems.
Solution 11: Standardize the Build Setup
For Kotlin 2.x:
plugins { id("org.jetbrains.kotlin.android") id("org.jetbrains.kotlin.plugin.compose") }
android {
buildFeatures {
compose = true
}
}
For a legacy Kotlin 1.x project, keep a compatible old Compose Compiler configuration until the project is migrated.
Cause 10: Suppressing the Compatibility Check
Older Compose Compiler releases contained mechanisms related to Kotlin version compatibility checking.
Suppressing a compatibility check simply to make the build proceed does not guarantee that the compiler combination is actually safe. The official Compose Compiler release history documents the Kotlin-targeted nature of these compiler releases. :contentReference[oaicite:27]{index=27}
Recommended: Use an officially compatible Kotlin/Compose Compiler setup instead of bypassing the compatibility check.
Step 1: Search for the Kotlin Version
In libs.versions.toml:
[versions] kotlin = "..."
or:
id("org.jetbrains.kotlin.android") version "..."
Step 2: Search for the Compose Compiler Configuration
Search the project for:
kotlinCompilerExtensionVersion
and:
org.jetbrains.kotlin.plugin.compose
This quickly reveals whether the project is using the legacy or modern model.
Step 3: Check Applied Plugins
On Kotlin 2.x, Compose-enabled modules should use the Compose compiler plugin where required:
org.jetbrains.kotlin.plugin.compose
Step 4: Run Gradle Sync
File → Sync Project with Gradle Files
Compatibility problems can surface during either sync or compilation.
Step 5: Build from the Command Line
macOS or Linux:
./gradlew assembleDebug
Windows:
gradlew.bat assembleDebug
Read the first compiler or plugin error rather than relying only on Android Studio highlighting.
Solution 12: Inspect Dependencies
macOS or Linux:
./gradlew :app:dependencies
Windows:
gradlew.bat :app:dependencies
Verify that Compose Runtime, UI, Material, and other libraries are being resolved as expected.
Solution 13: Use the Compose BOM
dependencies { val composeBom = platform( "androidx.compose:compose-bom:2026.08.00" )
implementation(composeBom)
implementation(
"androidx.compose.ui:ui"
)
implementation(
"androidx.compose.material3:material3"
)
}
Google’s current Compose Compiler setup documentation lists Compose BOM 2026.08.00. :contentReference[oaicite:28]{index=28}
Solution 14: Upgrade Large Legacy Projects in Stages
If the project is several years old, changing all of these at once can make diagnosis difficult:
Kotlin AGP Gradle Compose AndroidX
A more controlled process is:
1. Gradle / AGP 2. Kotlin 3. Compose compiler configuration 4. Compose BOM / libraries
Build between stages so you know which change introduces a failure.
Solution 15: Clean and Rebuild
macOS or Linux:
./gradlew clean ./gradlew assembleDebug
Windows:
gradlew.bat clean gradlew.bat assembleDebug
Cleaning does not repair an incompatible version combination, but it is useful after correcting the build configuration.
Solution 16: Search for Legacy Compiler Options
Search the entire project for:
kotlinCompilerExtensionVersion
After a Kotlin 2.x migration, verify that an old configuration was not left behind in another module.
Solution 17: Keep Plugin Versions in One Place
A Version Catalog can reduce accidental mismatches:
[versions] kotlin = "2.3.21"
Both the Kotlin Android and Compose Compiler plugins can reference this single version entry.
Modern Configuration Example
libs.versions.toml:
[versions] kotlin = "2.3.21"
[plugins]
kotlin-android = {
id = "org.jetbrains.kotlin.android",
version.ref = "kotlin"
}
compose-compiler = {
id = "org.jetbrains.kotlin.plugin.compose",
version.ref = "kotlin"
}
Module build.gradle.kts:
plugins { alias( libs.plugins.kotlin.android )
alias(
libs.plugins.compose.compiler
)
}
android {
buildFeatures {
compose = true
}
}
dependencies {
val composeBom =
platform(
"androidx.compose:compose-bom:2026.08.00"
)
implementation(composeBom)
implementation(
"androidx.compose.material3:material3"
)
}
Google’s current documentation uses the same model: Kotlin 2.x, the Compose Compiler Gradle plugin using the Kotlin version, Compose enabled in build features, and a Compose BOM for library alignment. :contentReference[oaicite:29]{index=29}
Legacy Kotlin 1.x Example
plugins { id("org.jetbrains.kotlin.android") version "1.9.25" }
android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion =
"1.5.15"
}
}
Google’s official release notes state that Compose Compiler 1.5.15 targets Kotlin 1.9.25. :contentReference[oaicite:30]{index=30}
If You See “Compose Compiler requires Kotlin…”
If the error explicitly names the required Kotlin version:
This version of the Compose Compiler requires Kotlin version X.X.X
compare the project’s:
Kotlin version Compose Compiler version
In a legacy setup, they are probably incompatible.
If You See “Kotlin version is not supported”
Compose is not the only tool that depends on specific Kotlin versions.
KSP, Room processing, Kotlin Serialization, and other compiler plugins can also produce Kotlin-version errors.
If the Compose configuration appears correct, read the complete error and identify which plugin is actually reporting the incompatibility.
If the Project Uses KSP
A Kotlin upgrade can produce this sequence:
Kotlin upgraded ↓ Compose Compiler Plugin is compatible ↓ KSP reports its own version problem
Always diagnose the first meaningful Gradle error instead of assuming every Kotlin compatibility error comes from Compose.
Will Updating Android Studio Fix It?
Updating Android Studio alone does not rewrite incompatible Kotlin and Compose Compiler versions in your Gradle files.
A newer IDE may be required for newer AGP or Kotlin versions, but the build configuration still needs to be corrected explicitly.
Should You Clear Caches?
Not as the first step.
For version compatibility errors, use this order:
1. Check Kotlin version 2. Check Compose compiler configuration 3. Check applied plugins 4. Run Gradle Sync 5. Clean and rebuild 6. Restart the IDE
An IDE cache reset cannot make genuinely incompatible compiler versions compatible.
Kotlin 2.x Migration Checklist
- Confirm Kotlin is 2.0 or later.
- Add
org.jetbrains.kotlin.plugin.compose. - Use the same version for Kotlin and the Compose Compiler plugin.
- Remove or migrate obsolete compiler-extension settings.
- Enable Compose with
compose = true. - Do not confuse the Compose BOM with the compiler plugin.
- Apply the plugin to every Compose module that needs it.
- Confirm that Gradle Sync succeeds.
Kotlin 1.x Checklist
- Check the Kotlin version.
- Check
kotlinCompilerExtensionVersion. - Use a Compose Compiler version compatible with that Kotlin version.
- Do not update Kotlin alone.
- Do not update the Compose Compiler alone.
- Sync and rebuild after changing versions.
Fastest Troubleshooting Order
- Find the project’s Kotlin version.
- Determine whether it uses Kotlin 2.x or Kotlin 1.x.
- For Kotlin 2.x, use
org.jetbrains.kotlin.plugin.compose. - Match the Compose Compiler plugin version to Kotlin.
- For Kotlin 1.x, verify the compatible
kotlinCompilerExtensionVersion. - Confirm
buildFeatures.compose = true. - Check the Compose BOM separately from the compiler plugin.
- Run Gradle Sync.
- Run
./gradlew assembleDebug.
If the Error Still Occurs
Check all of the following:
- The actual Kotlin version used by Gradle
- The Compose Compiler plugin version
- Whether a Kotlin 2.x project still uses legacy compiler configuration
- Whether a Kotlin 1.x project uses an incompatible old compiler
- Whether the Version Catalog points the two plugins to different versions
- Whether one module still contains old settings
- Whether an old compiler artifact is manually declared
- Whether Compose is enabled
- Whether the Compose BOM is being confused with the compiler version
- Whether KSP or another plugin is actually reporting the Kotlin problem
- Whether Gradle Sync completes successfully
- Whether you read the first relevant Gradle error
Summary
Jetpack Compose Kotlin compatibility errors usually occur because the Kotlin version and Compose Compiler configuration do not match the configuration model expected by the project.
The biggest distinction is between modern Kotlin 2.x projects and legacy Kotlin 1.x projects.
With Kotlin 2.0 and later, use:
org.jetbrains.kotlin.plugin.compose
and keep the Compose Compiler plugin version aligned with Kotlin. Google’s current Android documentation explicitly recommends this setup and states that the plugin is available for Kotlin 2.0+. :contentReference[oaicite:31]{index=31}
For example:
[versions] kotlin = "2.3.21"
[plugins]
kotlin-android = {
id = "org.jetbrains.kotlin.android",
version.ref = "kotlin"
}
compose-compiler = {
id = "org.jetbrains.kotlin.plugin.compose",
version.ref = "kotlin"
}
Legacy Kotlin 1.x projects instead use the older compiler-extension model, where the Kotlin and Compose Compiler versions must be explicitly compatible. Compose Compiler 1.5.15, for example, was released targeting Kotlin 1.9.25. :contentReference[oaicite:32]{index=32}
The Compose BOM is separate from this compiler relationship. Google’s current setup page lists Compose BOM 2026.08.00, but the modern Compose Compiler plugin follows the Kotlin version instead. :contentReference[oaicite:33]{index=33}
When a compatibility error occurs, check the project in this order: Kotlin version → Compose Compiler configuration → applied plugins → Compose BOM → Gradle Sync. That usually identifies the actual mismatch much faster than clearing caches or repeatedly reinstalling Android Studio.
