Is there any additional documentation for publishi...
# multiplatform
g
Is there any additional documentation for publishing Kotlin Multiplatform libraries outside of this one documentation page? https://kotlinlang.org/docs/multiplatform-publish-lib.html I wrote 6 small libraries in a monorepo and published them all using the
publishAllPublicationsToPersonalMavenRepository
task (where
PersonalMaven
is the name I gave my personal maven repo’s config). About 50% of the JVM packages and my one android-only library can’t resolve for some reason. The JVM ones all seem to be related to the fact that some of my JVM artifacts are
-desktop
instead of
-jvm
, even though the KMP artifact’s Kotlin metadata file says the JVM target is supported and its
.module
correctly points to the
-desktop
artifact. The iOS, Android, jsWasm, and JS packages resolve perfectly fine for some reason.
This is one of the JVM ones for example:
Copy code
:shared:desktopMain: Could not find dev.henkle:compose-better-bottom-sheet-jvm:1.0.0.
Required by:
    project :shared > dev.henkle:compose-better-bottom-sheet:1.0.0
It’s looking for an artifact with the
-jvm
suffix when the real artifact ends in
-desktop
. The issue I’m running into on Android seems to be somewhat related. It is trying to use the KMP artifact instead of the
-android
artifact. As before, the Kotlin metadata file and
.module
correctly identify the
-android
artifact, so it shouldn’t have issues resolving:
Copy code
No matching variant of dev.henkle:context-provider:1.0.0 was found. The consumer was configured to find a library for use during runtime, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.2.2', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
  - Variant 'metadataApiElements' capability dev.henkle:context-provider:1.0.0 declares a library:
      - Incompatible because this component declares a component for use during 'kotlin-metadata', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed a component for use during runtime, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'
I feel like I’m missing something really simple, but the documentation is super sparse on this.