Search code examples
kotlingradleandroid-jetpack-composekotlin-multiplatform

How to fix KMP issue - Please initialize at least one Kotlin target in 'composeApp (:composeApp)' or 'shared'?


I am facing this issue when trying to update Kotlin from 1.9.23 to 2.0.0 in compose multiplatform project. Updated version of Kotlin in my libs.versions.toml file

kotlin = "2.0.0"
compose = "1.6.1"

Solution

  • The issue lies with Compose version 1.6.1, which does not support Kotlin 2.0.0. To resolve this, you need to update to Compose version 1.6.11.

    Here's how you can do it:

    Open your libs.versions.toml file. Update the version numbers as follows:

    kotlin = "2.0.0"
    compose = "1.6.11"