Arkadii Ivanov
08/31/2023, 4:52 PMkotlinx-serialization
to a KMP module, but I'm getting the following error (details in the thread). What could be an issue?
Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0
Arkadii Ivanov
08/31/2023, 4:52 PMExecution failed for task ':state-keeper:compileKotlinMetadata'.
> Could not resolve all files for configuration ':state-keeper:metadataCompileClasspath'.
> Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0.
Required by:
project :state-keeper
> The consumer was configured to find a library for use during 'kotlin-api', 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 org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0:
- androidNativeArm32ApiElements-published
- androidNativeArm64ApiElements-published
- androidNativeX64ApiElements-published
- androidNativeX86ApiElements-published
- iosArm32ApiElements-published
- iosArm64ApiElements-published
- iosSimulatorArm64ApiElements-published
- iosX64ApiElements-published
- jsApiElements-published
- jvmApiElements-published
- jvmRuntimeElements-published
- linuxArm32HfpApiElements-published
- linuxArm64ApiElements-published
- linuxX64ApiElements-published
- macosArm64ApiElements-published
- macosX64ApiElements-published
- mingwX64ApiElements-published
- mingwX86ApiElements-published
- tvosArm64ApiElements-published
- tvosSimulatorArm64ApiElements-published
- tvosX64ApiElements-published
- watchosArm32ApiElements-published
- watchosArm64ApiElements-published
- watchosDeviceArm64ApiElements-published
- watchosSimulatorArm64ApiElements-published
- watchosX64ApiElements-published
- watchosX86ApiElements-published
Arkadii Ivanov
08/31/2023, 5:16 PMbuild.gradle
is pretty simple:
plugins {
id("kotlin-multiplatform")
kotlin("plugin.serialization") version "1.9.0"
}
kotlin {
jvm()
js { browser() }
sourceSets {
commonMain {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
}
}
}
}
Kotlin 1.9.0John O'Reilly
08/31/2023, 5:28 PMkotlinx-serialization-json
and seemed to find it (projects also included those targets)Arkadii Ivanov
08/31/2023, 5:29 PMJohn O'Reilly
08/31/2023, 5:29 PMArkadii Ivanov
08/31/2023, 5:29 PMArkadii Ivanov
08/31/2023, 5:29 PMArkadii Ivanov
08/31/2023, 5:32 PMArkadii Ivanov
08/31/2023, 5:45 PMkotlin.mpp.enableCompatibilityMetadataVariant=true
in gradle.plroperties