Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commonMainMetadataElements variant missing since 0.12.0 (Kotlin 1.6.20) #66

Closed
baole opened this issue Jun 13, 2022 · 6 comments
Closed

Comments

@baole
Copy link

baole commented Jun 13, 2022

I'm using this library for our shared library and having this following issue after upgrading to version 0.12.x (0.12.0, 0.12.1, 0.12.2 with Kotlin 1.6.21 and 0.12.3 with Kotlin 1.7.0). There is no issue with version 0.11.x. Do you have any idea?

Execution failed for task ':KmpSdk:compileKotlinMetadata'.
> Error while evaluating property 'filteredArgumentsMap' of task ':KmpSdk:compileKotlinMetadata'
   > Could not resolve all files for configuration ':KmpSdk:metadataCompileClasspath'.
      > Could not resolve com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0.
        Required by:
            project :KmpSdk
         > 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 com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0:
             - iosArm64ApiElements-published
             - iosSimulatorArm64ApiElements-published
             - iosX64ApiElements-published
             - jsIrApiElements-published
             - jsLegacyApiElements-published
             - jvmApiElements-published
             - jvmRuntimeElements-published
             - linuxX64ApiElements-published
             - macosArm64ApiElements-published
             - macosX64ApiElements-published
             - mingwX64ApiElements-published
             - tvosArm64ApiElements-published
             - tvosSimulatorArm64ApiElements-published
             - tvosX64ApiElements-published
             - watchosArm32ApiElements-published
             - watchosArm64ApiElements-published
             - watchosSimulatorArm64ApiElements-published
             - watchosX64ApiElements-published
           All of them match the consumer attributes:
             - Variant 'iosArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'ios_arm64' but the consumer didn't ask for it
             - Variant 'iosSimulatorArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'ios_simulator_arm64' but the consumer didn't ask for it
             - Variant 'iosX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'ios_x64' but the consumer didn't ask for it
             - Variant 'jsIrApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
                 - 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
                     - Provides attribute 'org.jetbrains.kotlin.js.compiler' with value 'ir' but the consumer didn't ask for it
             - Variant 'jsLegacyApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
                 - 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
                     - Provides attribute 'org.jetbrains.kotlin.js.compiler' with value 'legacy' but the consumer didn't ask for it
             - Variant 'jvmApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares an API of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
                 - Unmatched attributes:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                     - Provides its elements packaged as a jar but the consumer didn't ask for it
                     - Provides release status but the consumer didn't ask for it
             - Variant 'jvmRuntimeElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a runtime of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
                 - Unmatched attributes:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                     - Provides its elements packaged as a jar but the consumer didn't ask for it
                     - Provides release status but the consumer didn't ask for it
             - Variant 'linuxX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'linux_x64' but the consumer didn't ask for it
             - Variant 'macosArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'macos_arm64' but the consumer didn't ask for it
             - Variant 'macosX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'macos_x64' but the consumer didn't ask for it
             - Variant 'mingwX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'mingw_x64' but the consumer didn't ask for it
             - Variant 'tvosArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'tvos_arm64' but the consumer didn't ask for it
             - Variant 'tvosSimulatorArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'tvos_simulator_arm64' but the consumer didn't ask for it
             - Variant 'tvosX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'tvos_x64' but the consumer didn't ask for it
             - Variant 'watchosArm32ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'watchos_arm32' but the consumer didn't ask for it
             - Variant 'watchosArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'watchos_arm64' but the consumer didn't ask for it
             - Variant 'watchosSimulatorArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'watchos_simulator_arm64' but the consumer didn't ask for it
             - Variant 'watchosX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'watchos_x64' but the consumer didn't ask for it
           The following variants were also considered but didn't match the requested attributes:
             - Variant 'iosArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'iosSimulatorArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'iosX64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'jsIrRuntimeElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
                 - Incompatible because this component declares a usage of 'kotlin-runtime' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'jsLegacyRuntimeElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
                 - Incompatible because this component declares a usage of 'kotlin-runtime' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'macosArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'macosX64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'metadataApiElements' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'tvosArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'tvosSimulatorArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'tvosX64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'watchosArm32MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'watchosArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'watchosSimulatorArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'watchosX64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-core:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
      > Could not resolve com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0.
        Required by:
            project :KmpSdk
         > 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 com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0:
             - iosArm64ApiElements-published
             - iosSimulatorArm64ApiElements-published
             - iosX64ApiElements-published
             - jsIrApiElements-published
             - jsLegacyApiElements-published
             - jvmApiElements-published
             - jvmRuntimeElements-published
             - linuxX64ApiElements-published
             - macosArm64ApiElements-published
             - macosX64ApiElements-published
             - mingwX64ApiElements-published
             - tvosArm64ApiElements-published
             - tvosSimulatorArm64ApiElements-published
             - tvosX64ApiElements-published
             - watchosArm32ApiElements-published
             - watchosArm64ApiElements-published
             - watchosSimulatorArm64ApiElements-published
             - watchosX64ApiElements-published
           All of them match the consumer attributes:
             - Variant 'iosArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'ios_arm64' but the consumer didn't ask for it
             - Variant 'iosSimulatorArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'ios_simulator_arm64' but the consumer didn't ask for it
             - Variant 'iosX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'ios_x64' but the consumer didn't ask for it
             - Variant 'jsIrApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
                 - 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
                     - Provides attribute 'org.jetbrains.kotlin.js.compiler' with value 'ir' but the consumer didn't ask for it
             - Variant 'jsLegacyApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
                 - 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
                     - Provides attribute 'org.jetbrains.kotlin.js.compiler' with value 'legacy' but the consumer didn't ask for it
             - Variant 'jvmApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares an API of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
                 - Unmatched attributes:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                     - Provides its elements packaged as a jar but the consumer didn't ask for it
                     - Provides release status but the consumer didn't ask for it
             - Variant 'jvmRuntimeElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a runtime of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
                 - Unmatched attributes:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                     - Provides its elements packaged as a jar but the consumer didn't ask for it
                     - Provides release status but the consumer didn't ask for it
             - Variant 'linuxX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'linux_x64' but the consumer didn't ask for it
             - Variant 'macosArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'macos_arm64' but the consumer didn't ask for it
             - Variant 'macosX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'macos_x64' but the consumer didn't ask for it
             - Variant 'mingwX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'mingw_x64' but the consumer didn't ask for it
             - Variant 'tvosArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'tvos_arm64' but the consumer didn't ask for it
             - Variant 'tvosSimulatorArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'tvos_simulator_arm64' but the consumer didn't ask for it
             - Variant 'tvosX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'tvos_x64' but the consumer didn't ask for it
             - Variant 'watchosArm32ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'watchos_arm32' but the consumer didn't ask for it
             - Variant 'watchosArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'watchos_arm64' but the consumer didn't ask for it
             - Variant 'watchosSimulatorArm64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'watchos_simulator_arm64' but the consumer didn't ask for it
             - Variant 'watchosX64ApiElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Unmatched attributes:
                     - Provides attribute 'artifactType' with value 'org.jetbrains.kotlin.klib' but the consumer didn't ask for it
                     - 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
                     - Provides attribute 'org.jetbrains.kotlin.native.target' with value 'watchos_x64' but the consumer didn't ask for it
           The following variants were also considered but didn't match the requested attributes:
             - Variant 'iosArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'iosSimulatorArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'iosX64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'jsIrRuntimeElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
                 - Incompatible because this component declares a usage of 'kotlin-runtime' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'jsLegacyRuntimeElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
                 - Incompatible because this component declares a usage of 'kotlin-runtime' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'macosArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'macosX64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'metadataApiElements' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'tvosArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'tvosSimulatorArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'tvosX64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'watchosArm32MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'watchosArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'watchosSimulatorArm64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
             - Variant 'watchosX64MetadataElements-published' capability com.rickclephas.kmp:kmp-nativecoroutines-annotations:0.12.0 declares a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - Incompatible because this component declares a usage of 'kotlin-metadata' of a component and the consumer needed a usage of 'kotlin-api' of a component
                 - Other compatible attribute:
                     - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

@rickclephas
Copy link
Owner

Hi @baole, thanks for the report!
Is this a library project and what targets does your project support?

@baole
Copy link
Author

baole commented Jun 13, 2022

Thanks @rickclephas. Yes, it's a library project, target Android and iOS. Here is a snippet of my gradle file

    android {
        publishLibraryVariants("release")
    }
    val xcf = XCFramework()

    ios {
        binaries.framework {
            baseName = artifactId
            xcf.add(this)
        }
    }

    // note support Apple Silicon
    iosSimulatorArm64 {
        binaries.framework {
            baseName = artifactId
            xcf.add(this)
        }
    }

    cocoapods {
        summary = "The Tandem SDK"
        homepage = "https://gitlab.com/tandem-net/clients/sdks/kmp-sdk"
        version = "1.5.0"
        ios.deploymentTarget = Versions.ios_deployment_target
        podfile = project.file("../sampleIos/Podfile")
        framework {
            baseName = artifactId
        }
    }

@rickclephas
Copy link
Owner

I did some digging and this looks like an issue with the Kotlin 1.6.20 update. Probably related to KT-51293.

Used the following command to output the variants of the kmp-nativecoroutines-core module:

./gradlew :kmp-nativecoroutines-core:outgoingVariants

Comparing the output for c1b7821...24a3255 results in:

diff --git a/outgoingVariants-1.6.10.txt b/outgoingVariants-1.6.20-M1.txt
index 64d80cc..ab5f07c 100644
--- a/outgoingVariants-1.6.10.txt
+++ b/outgoingVariants-1.6.20-M1.txt
@@ -1,18 +1,4 @@
 > Task :kmp-nativecoroutines-core:outgoingVariants
---------------------------------------------------
-Variant commonMainMetadataElements
---------------------------------------------------
-Capabilities
-    - com.rickclephas.kmp:kmp-nativecoroutines-core:0.11.2 (default capability)
-Attributes
-    - org.gradle.category                = library
-    - org.gradle.jvm.environment         = non-jvm
-    - org.gradle.usage                   = kotlin-api
-    - org.jetbrains.kotlin.platform.type = common
-
-Artifacts
-    - build/libs/kmp-nativecoroutines-core-0.11.2.jar (artifactType = jar)
-
 --------------------------------------------------
 Variant iosArm64ApiElements
 --------------------------------------------------
@@ -414,7 +400,7 @@ Attributes
     - org.jetbrains.kotlin.platform.type = common

 Artifacts
-    - build/libs/kmp-nativecoroutines-core-metadata-0.11.2-all.jar (artifactType = jar)
+    - build/libs/kmp-nativecoroutines-core-metadata-0.11.2.jar (artifactType = jar)

 --------------------------------------------------
 Variant mingwX64ApiElements

@rickclephas rickclephas changed the title Error on library version 0.12.x commonMainMetadataElements variant missing since 0.12.0 (Kotlin 1.6.20) Jun 13, 2022
@baole
Copy link
Author

baole commented Jun 15, 2022

@rickclephas thanks for checking the issue. It works when setting kotlin.mpp.enableCompatibilityMetadataVariant=false

@rickclephas
Copy link
Owner

Alright that actually makes sense since KMP-NativeCoroutines only supports hierarchical projects.

Still it seems something has changed since Kotlin 1.6.20.
KMP-NativeCoroutines has never had the kotlin.mpp.enableCompatibilityMetadataVariant property set.

@rickclephas
Copy link
Owner

So it turns out the value of kotlin.mpp.enableCompatibilityMetadataVariant has actually been switched from true to false with the update to Kotlin 1.6.20.

The old documentation about migrating to the hierarchical project structure mentioned that enableCompatibilityMetadataVariant would default to false.
In Kotlin 1.4.20 this was changed to default to true, but the documentation was never updated.

Kotlin 1.6.20 introduced kotlin.internal.mpp.hierarchicalStructureByDefault (which defaults to true).
When hierarchicalStructureByDefault is enabled enableCompatibilityMetadataVariant will default to false

Since KMP-NativeCoroutines never explicitly specified the enableCompatibilityMetadataVariant value it switched from true to false with the update to Kotlin 1.6.20. However the intended behaviour has always been for it to be false.

Like you already mentioned, the fix is to disable the compatibility metadata by removing the enableCompatibilityMetadataVariant property, or explicitly setting it to false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants