I am in a `jvm` module, and I want to have access ...
# compose-desktop
s
I am in a
jvm
module, and I want to have access to some compose classes. I get a problem, where I get an error which among other things says
Copy code
AmbiguousConfigurationSelectionException: Cannot choose between the following variants of org.jetbrains.skiko:skiko androidRuntimeElements-published awtRuntimeElements-published
Looks a lot like this issue but isn’t quite the same. Anyone experienced this before? Not sure if it’s the right channel but thought I’d give it a try.
For those curious, my use case is that it’s a module containing some KSP code and I’m using KotlinPoet to generate the code. In order to get a reference to these functions I thought I’d add a dependency to the artifacts who provide these dependencies. Specifically
runtime
for @Composable and @Stable, and
ui
for Modifier, since that’s what the generated code generates for now.
The artifacts I’m trying to depend on are •
org.jetbrains.compose.runtime:runtime
org.jetbrains.compose.ui:ui
And some more of the error:
Copy code
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.jetbrains.skiko:skiko:0.7.34.
Required by:
    project :common > project :kspProcessors > org.jetbrains.compose.ui:ui:1.2.0 > org.jetbrains.compose.ui:ui-desktop:1.2.0
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.jetbrains.skiko:skiko:0.7.34.

    project :common > project :kspProcessors > org.jetbrains.compose.ui:ui:1.2.0 > org.jetbrains.compose.ui:ui-desktop:1.2.0 > org.jetbrains.compose.ui:ui-graphics:1.2.0 > org.jetbrains.compose.ui:ui-graphics-desktop:1.2.0
    project :common > project :kspProcessors > org.jetbrains.compose.ui:ui:1.2.0 > org.jetbrains.compose.ui:ui-desktop:1.2.0 > org.jetbrains.compose.ui:ui-text:1.2.0 > org.jetbrains.compose.ui:ui-text-desktop:1.2.0
Caused by: org.gradle.internal.component.AmbiguousConfigurationSelectionException: Cannot choose between the following variants of org.jetbrains.skiko:skiko:0.7.34:
  - androidRuntimeElements-published
  - awtRuntimeElements-published
All of them match the consumer attributes:
  - Variant 'androidRuntimeElements-published' capability org.jetbrains.skiko:skiko:0.7.34:
Caused by: org.gradle.internal.component.AmbiguousConfigurationSelectionException: Cannot choose between the following variants of org.jetbrains.skiko:skiko:0.7.34:

      - Unmatched attributes:
          - Provides org.gradle.category 'library' but the consumer didn't ask for it
          - Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
          - Provides org.gradle.status 'release' but the consumer didn't ask for it
          - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
          - Provides org.jetbrains.kotlin.platform.type 'jvm' but the consumer didn't ask for it
          - Provides ui 'android' but the consumer didn't ask for it
  - Variant 'awtRuntimeElements-published' capability org.jetbrains.skiko:skiko:0.7.34:
      - Unmatched attributes:
          - Provides org.gradle.category 'library' but the consumer didn't ask for it
          - Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
          - Provides org.gradle.status 'release' but the consumer didn't ask for it
          - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
          - Provides org.jetbrains.kotlin.platform.type 'jvm' but the consumer didn't ask for it
It does mention not resolving Skiko, I’ve tried adding that dependency manually too, to no results unfortunately.