Thread
#multiplatform
    p

    patjackson52

    2 years ago
    Are there any known bugs with 1.4.0-rc & publishing/dependency resolution? I’m getting a build error when adding a dep with the follow:
    The consumer was configured to find a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common'. However we cannot choose between the following variants of:
    it then proceeds to list all of the variants. When looking at the module file there is only one artifact with type ‘org.jetbrains.kotlin.platform.type’ (the metadata module). Anyone else seeing this?
    maybe something not configured right on my side. I see that the metadata module does not have
    "org.gradle.usage": "kotlin-api"
    . So it is not matching both criteria (usage & type)
    I’m publisher of the lib that I’m importing. Both publisher and consumer are using kotlin 1.4.0-rc & gradle 6.5.1
    I’m attempting to declare the dependency in a common module in the commonMain {} block.
    Looking back at prev version .module file:
    {
          "name": "metadata-api",
          "attributes": {
            "org.gradle.usage": "kotlin-api",
            "org.jetbrains.kotlin.platform.type": "common"
          },
    new 1.4.0-rc & gradle 6.5.1 module file:
    {
          "name": "metadata-api",
          "attributes": {
            "org.gradle.usage": "kotlin-metadata",
            "org.jetbrains.kotlin.platform.type": "common"
          },
    So
    org.gradle.usage"
    changed. I also have removed enableFeaturePreview(‘GRADLE_METADATA’) from settings.gradle as I though it was no longer needed. Going to attempt publishing with this enabled again.
    No, that didn’t work. I’m stumped. Other changes between last working where migrating to kts build files. I don’t expect that to impact publishing.
    I’m stumped. does not appear to be a gradle or kotlin version issue. I did change which platforms are being build and published (added several)
    natario1

    natario1

    2 years ago
    @patjackson52 have you ever found a solution to this?
    p

    patjackson52

    2 years ago
    Yes. I updated everything (Gradle & kotlin version) and it worked. Not sure if it was an environmental thing or I got an updated depenceny that fixed it