JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.39k stars 1.12k forks source link

Compose Navigation Dependency import failed #4686

Closed breakingbeats closed 2 months ago

breakingbeats commented 2 months ago

Bug description When I want to include Navigation Compose for Compose Multiplatform, a build error is generated that looks like this: Module "org.jetbrains.compose.foundation:foundation" has a reference to symbol org.jetbrains.skiko/SkikoKey.platformKeyCode.|(){}[0]. Neither the module itself nor its dependencies contain such declaration.

This could happen if the required dependency is missing in the project. Or if there is a dependency of "org.jetbrains.compose.foundation:foundation" that has a different version in the project than the version that "org.jetbrains.compose.foundation:foundation" was initially compiled with. Please check that the project configuration is correct and has consistent versions of all required dependencies.

Affected platforms

Versions

To Reproduce Steps and/or the code snippet to reproduce the behavior: commonMain.dependencies { implementation(projects.shared) implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material3) implementation(compose.ui) implementation(compose.materialIconsExtended) implementation(compose.components.resources) implementation(compose.components.uiToolingPreview)

//comment in compose navigation reproduces the build error //implementation(libs.compose.navigation) }

MatkovIvan commented 2 months ago

There is no mention of navigation library version in the description, but in the current state it's clear that

Compose Multiplatform version*: 1.6.2

is a cause of version conflict, please use the version of Compose from the same release

In the case of the latest beta it's: Gradle Plugin org.jetbrains.compose, version 1.6.10-beta01 Navigation libraries org.jetbrains.androidx.navigation:navigation-*:2.8.0-alpha01.