https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
u

Ugi

10/19/2020, 9:14 PM
Hey all, I think I'm having some troubles with my maven snapshot publishing. I'm using three different machines to publish to various mac linux and windows builds, each of those creates their own common entry, but the problem is, modules file in those common entries contain links only to artifacts from that machine, i.e. mac: https://oss.sonatype.org/content/repositories/snapshots/com/ionspin/kotlin/multiplatform-crypto-libsodium-bindings/0.1.1-SNAPSHOT/multiplatform-crypto-libsodium-bindings-0.1.1-20201019.205459-4.module linux: https://oss.sonatype.org/content/repositories/snapshots/com/ionspin/kotlin/multiplatform-crypto-libsodium-bindings/0.1.1-SNAPSHOT/multiplatform-crypto-libsodium-bindings-0.1.1-20201019.202701-1.module So the problem is as follows: If the last machine to publish to snapshot with the same version was
mac
, trying to resolve the dependancy for a sample project on
linux
machine will fail because it's missing links to artifacts in latest module:
Copy code
No matching variant of com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.1.1-SNAPSHOT:20201019.205459-4 was found. The consumer was configured to find an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
          - Variant 'iosArm32-api' capability com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:0.1.1-SNAPSHOT:
              - Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed an API of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'
              - Other compatible attribute:
                  - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
And vice versa. I haven't faced this behavior before, so is it something new, or am I doing something stupid because I'm tired?
Yup, I was doing something stupid, but I'll share it here just in case somebody else faces the same issue. I was disabling targets based on the host OS.On my other projects I wasn't doing this, so linux host os would collect all the targets and create a correct
.modules
common file when publishing to maven. And in any case ios/osx and windows targets wont run on linux so disabling them didn't bring any benefit.