AAkira / Napier

Logging library for Kotlin Multiplatform
Apache License 2.0
831 stars 37 forks source link

Library is not resolved with Kotlin Multiplatform 1.6.10 #91

Closed grv87 closed 2 years ago

grv87 commented 2 years ago

build.gradle.kts:

plugins {
    id("org.jetbrains.kotlin.multiplatform") version "1.6.10" // Change version here
}

repositories {
    mavenCentral()
}

kotlin {
    targets {
        jvm()
    }

    sourceSets {
        commonMain {
            dependencies {
                implementation("io.github.aakira:napier:2.2.0")
            }
        }
    }
}

Run gradle assemble and see:

Execution failed for task ':compileKotlinMetadata'.
> Error while evaluating property 'filteredArgumentsMap' of task ':compileKotlinMetadata'
   > Could not resolve all files for configuration ':metadataCompileClasspath'.
      > Could not resolve io.github.aakira:napier:2.2.0.
        Required by:
            project :
         > The consumer was configured to find a usage of 'kotlin-api' of a library, preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common'. However we cannot choose between the following variants of io.github.aakira:napier:2.2.0:
             - commonMainMetadataElements
             - debugApiElements-published
             - debugRuntimeElements-published
             - iosArm64ApiElements-published
             - iosSimulatorArm64ApiElements-published
             - iosX64ApiElements-published
             - jsIrApiElements-published
             - jsLegacyApiElements-published
             - jvmApiElements-published
             - jvmRuntimeElements-published
             - macosArm64ApiElements-published
             - macosX64ApiElements-published
             - releaseApiElements-published
             - releaseRuntimeElements-published
             - tvosArm64ApiElements-published
             - tvosSimulatorArm64ApiElements-published
             - tvosX64ApiElements-published
             - watchosArm32ApiElements-published
             - watchosArm64ApiElements-published
             - watchosSimulatorArm64ApiElements-published
             - watchosX64ApiElements-published
           All of them match the consumer attributes:
             - Variant 'commonMainMetadataElements' capability io.github.aakira:napier:2.2.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common':
                 - Unmatched attributes:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                     - Provides release status but the consumer didn't ask for it
             - …

Version 1.6.0 gives no such error.

So far, I had this problem with Napier only. So, I'm reporting it here.

AAkira commented 2 years ago

I published Napier 2.3.0. Please check it.

frett commented 2 years ago

I was running into this same issue, and the upgrade to 2.3.0 resolved it for me. Thanks!