russhwolf / multiplatform-settings

A Kotlin Multiplatform library for saving simple key-value data
Apache License 2.0
1.7k stars 67 forks source link

Could not resolve dependency (since 0.9) #116

Closed stephanepechard closed 2 years ago

stephanepechard commented 2 years ago

Hi, Thanks for this library, which is very useful to all KMP users.

Since version 0.9, I have some difficulties building my app though. I get the following (quite verbose) error for each :

Execution failed for task ':module:compileKotlinMetadata'.
> Error while evaluating property 'filteredArgumentsMap' of task ':module:compileKotlinMetadata'
   > Could not resolve all files for configuration ':module:metadataCompileClasspath'.
      > Could not resolve com.russhwolf:multiplatform-settings:1.0.0-alpha01.
        Required by:
            project :module
         > 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.russhwolf:multiplatform-settings:1.0.0-alpha01:
             - androidNativeArm32ApiElements-published
             - androidNativeArm64ApiElements-published
             - androidNativeX64ApiElements-published
             - androidNativeX86ApiElements-published
             - debugApiElements-published
             - debugRuntimeElements-published
             - iosArm32ApiElements-published
             - iosArm64ApiElements-published
             - iosSimulatorArm64ApiElements-published
             - iosX64ApiElements-published
             - jsIrApiElements-published
             - jsLegacyApiElements-published
             - jvmApiElements-published
             - jvmRuntimeElements-published
             - linuxArm32HfpApiElements-published
             - linuxArm64ApiElements-published
             - linuxMips32ApiElements-published
             - linuxMipsel32ApiElements-published
             - linuxX64ApiElements-published
             - macosArm64ApiElements-published
             - macosX64ApiElements-published
             - mingwX64ApiElements-published
             - mingwX86ApiElements-published
             - releaseApiElements-published
             - releaseRuntimeElements-published
             - tvosArm64ApiElements-published
             - tvosSimulatorArm64ApiElements-published
             - tvosX64ApiElements-published
             - wasm32ApiElements-published
             - watchosArm32ApiElements-published
             - watchosArm64ApiElements-published
             - watchosSimulatorArm64ApiElements-published
             - watchosX64ApiElements-published
             - watchosX86ApiElements-published
           All of them match the consumer attributes:
             - Variant 'androidNativeArm32ApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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 'android_arm32' but the consumer didn't ask for it
             - Variant 'androidNativeArm64ApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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 'android_arm64' but the consumer didn't ask for it
             - Variant 'androidNativeX64ApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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 'android_x64' but the consumer didn't ask for it
             - Variant 'androidNativeX86ApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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 'android_x86' but the consumer didn't ask for it
             - Variant 'debugApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 declares an API of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
                 - Unmatched attributes:
                     - Provides attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' 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
             - Variant 'debugRuntimeElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 declares a runtime of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
                 - Unmatched attributes:
                     - Provides attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' 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
             - Variant 'iosArm32ApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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_arm32' but the consumer didn't ask for it
             - Variant 'iosArm64ApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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 'linuxArm32HfpApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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_arm32_hfp' but the consumer didn't ask for it
             - Variant 'linuxArm64ApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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_arm64' but the consumer didn't ask for it
             - Variant 'linuxMips32ApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - 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.native.target' with value 'linux_mips32' but the consumer didn't ask for it
             - Variant 'linuxMipsel32ApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
                 - 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.native.target' with value 'linux_mipsel32' but the consumer didn't ask for it
             - Variant 'linuxX64ApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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 'mingwX86ApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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_x86' but the consumer didn't ask for it
             - Variant 'releaseApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 declares an API of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
                 - 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
             - Variant 'releaseRuntimeElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 declares a runtime of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
                 - 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
             - Variant 'tvosArm64ApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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 'wasm32ApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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 'wasm32' but the consumer didn't ask for it
             - Variant 'watchosArm32ApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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
             - Variant 'watchosX86ApiElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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_x86' but the consumer didn't ask for it
           The following variants were also considered but didn't match the requested attributes:
             - Variant 'iosArm32MetadataElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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 'iosArm64MetadataElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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 'linuxMips32MetadataElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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 'linuxMipsel32MetadataElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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 'macosArm64MetadataElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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.russhwolf:multiplatform-settings:1.0.0-alpha01 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 'watchosX86MetadataElements-published' capability com.russhwolf:multiplatform-settings:1.0.0-alpha01 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)

I tried many configuration change to make it work, without success. It was working fine with version 0.8.1. To be more specific, I previously had the same error with my iOS build (through the assembleXCFramework task) and I fixed it by adding the iosX64() target to the gradle file. But now, I have the error by running the publishToMavenLocal task, so the Android/JVM part. Initially, I only had the android() target and I tried to add the jvm() with no luck.

My build.gradle.kts is the following:

plugins {
    kotlin("multiplatform")
    id(libs.plugins.kotlin.serialization.get().pluginId)
    id("com.android.library")
    id("daxium-maven-publish")
}

repositories {
    mavenCentral()
}

kotlin {
    android { publishAllLibraryVariants() }
    ios()
    iosX64()
    iosSimulatorArm64()

    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation(libs.settings)
                implementation(libs.settingsCoroutines)
                implementation(libs.settingsSerialization)
            }
        }

        val commonTest by getting {
            dependencies {
                implementation(libs.settingsTest)
            }
        }

        val androidMain by getting {
            dependencies {
                implementation(libs.settingsDataStore)
                implementation("androidx.datastore:datastore-preferences-core:1.0.0")
            }
        }

        val iosMain by getting
        val iosTest by getting
        val iosSimulatorArm64Main by getting { dependsOn(iosMain) }
        val iosSimulatorArm64Test by getting { dependsOn(iosTest) }
    }
}

android {
    compileSdk = Version.androidSdk
    sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
    defaultConfig {
        minSdk = Version.androidSdkMin
        targetSdk = Version.androidSdk
        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }
    testOptions {
        unitTests {
            isReturnDefaultValues = true
            all { test ->
                test.maxParallelForks = 8
            }
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_11
        targetCompatibility = JavaVersion.VERSION_11
    }
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
    kotlinOptions.jvmTarget = "11"
}

Do you have an idea on how to fix this? Thanks a lot!

russhwolf commented 2 years ago

If it's a publishing issue, maybe try using the standard maven-publish instead of daxium-maven-publish and see if it helps. I've never heard of the daxium plugin and have no idea if it might be doing something weird.

Otherwise, I'd need to hear a little more. What Kotlin version are you using? Do you have hmpp enabled? If you have a complete demo project that reproduces the error it might help.

stephanepechard commented 2 years ago

It's not a publishing issue, I have the same result without the maven plugin and using the assemble task. Sorry, my exemple is not very minimal. I use Kotlin 1.6.21, so hmpp is enabled. I will try to reduce my exemple with the same error as much as possible. Thanks for your help.

stephanepechard commented 2 years ago

Here is a small project, in which I reproduce the same error with the assemble task: test-kmp.zip Thanks for your help

russhwolf commented 2 years ago

It looks like the culprit iskotlin.mpp.enableCompatibilityMetadataVariant=true in your gradle.properties. That was previously enabled by default and no longer is as of Kotlin 1.6.20, so I'm guessing what's happening is that your project has trouble consuming a library that doesn't also have it. But you almost certainly don't need it so I'd recommend just removing that property. If you have a reason you actually do need it, let me know and I'll consider publishing an update with it enabled.

stephanepechard commented 2 years ago

You're right, removing this option fixes it! Thanks a lot for your time.