The Compose Compiler requires the Compose Runtime to be on the class path, but none could be found. The compose compiler plugin you are using (version 1.5.1) expects a minimum runtime version of 1.0.0.
An error occurred: implementation(libs.androidx.runtime) was added, but the error still appears.
This may happen if you don't use compose. Make sure that you are using compose plugins:
In your root build.gradle.kts
plugins {
// other plugins, and:
alias(libs.plugins.compose) apply false
alias(libs.plugins.compose.compiler) apply false
}
in your module, usage of them:
plugins {
// other plugins, and:
alias(libs.plugins.compose)
alias(libs.plugins.compose.compiler)
}
where the compose
, and compose.compiler
are defined in libs.versions.toml
, ex:
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version = "2.1.20" }
compose = { id = "org.jetbrains.compose", version = "1.8.0-beta02" }
Notice that this must be for every module is there. If you are using multiplatform, there'll be also the multiplatform plugin, and make sure you understand the KJVM MP project structure: https://kotlinlang.org/docs/multiplatform-discover-project.html as it much differs from Kotlin/JVM structure.