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.73k stars 1.14k forks source link

jsApp configuration of all example projects fails #3542

Open garretyoder opened 12 months ago

garretyoder commented 12 months ago

Describe the bug For seemingly all of the example projects (I've tested falling-balls, minesweeper) the build fails due to failed dependency resolution. androidx. and org.jetbrains. cannot be resolved. Other targets build fine, and I cannot see anything wrong in the build file.

Affected platforms

Versions

To Reproduce

  1. Download one of the example projects that has a web target
  2. Attempt to build the web target (or even just open it in Android Studio/IntelliJ
  3. Errors about unresolved imports will populate

Expected behavior Import should work and project should run as it does on all other configurations

Additional context I have made no modifications to the example project, only tried to build it.

mazunin-v-jb commented 12 months ago

Hello, thank you for submitting the issue!

Since Kotlin/JS 1.9.0 you need to explicitly specify the dependencies in your build.gradle.kts file. Like this:

val jsMain by getting  {
            dependencies {
                implementation(project(":shared"))
                implementation(compose.ui)
                ... // other required imports here.
            }
        }

We'll update our examples with that, thanks for noticing.

okushnikov commented 1 month ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.