congrats on 1.0.0 release :slightly_smiling_face: ...
# compose-desktop
f
congrats on 1.0.0 release 🙂 I'm trying to figure out what this error means:
Copy code
No matching variant of androidx.compose.runtime:runtime:1.1.0-beta01 was found. The consumer was configured to find an API of a library compatible with Java 15, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but:
          - Variant 'releaseVariantReleaseApiPublication' capability androidx.compose.runtime:runtime:1.1.0-beta01 declares an API of a library, and its dependencies declared externally:
              - Incompatible because this component declares a component, with the library elements 'aar' and the consumer needed a component, preferably in the form of class files
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 15)
when I copy the sample
imageView
into my pre-existing project and run
build
I noticed that I can change the version required in the following block, but I still don't understand the nature of the error, and I don't know how to reproduce in
imageviewer
folder of the
compose-jb/examples
itself, only when copied as a subfolder of my project
Copy code
kotlin {
    jvm {
        withJava()
    }
    sourceSets {
        named("jvmMain") {
            dependencies {
               implementation(compose.desktop.currentOs)
               implementation(project(":desktop:common"))
               implementation("androidx.compose.foundation:foundation:1.1.0-beta02")
               
            }
        }
    }
}
that comes from official sample, it mixes both. See
example/imageviewer
in
git@github.com:JetBrains/compose-jb.git
o
probably you can remove Android sourcesets, if don't need it. Error means Google's Android artifact is incompatible with the requested deps. As
build
in imageviewer works, likely you made some changes to script, i.e. different Gradle version.
f
upgraded to 7.1.1 like in sample
I tried that now, if I remove
implementation(compose.desktop.currentOs)
I get compiler errrors as expected:
Copy code
> Task :desktop:desktop:compileKotlinJvm FAILED
e: ...desktop/src/jvmMain/kotlin/example/imageviewer/Main.kt: (3, 8): Unresolved reference: androidx
it's interesting that having an android dependency in the original project's sourceSet does NOT cause an error
Copy code
sourceSets {
        named("jvmMain") {
            dependencies {
                implementation(compose.desktop.currentOs)
                implementation(project(":common"))
                implementation("androidx.compose.foundation:foundation:1.0.1")
            }
        }
    }
even though it says it fails somehow
:desktop:dependencies
-->
\--- androidx.compose.foundation:foundation:1.0.1 FAILED