Reputation: 61
Running into a build issue when attempting to publish my game logic project to maven local:
Execution failed for task ':compileKotlinMetadata'.
> Error while evaluating property 'filteredArgumentsMap' of task ':compileKotlinMetadata'
> Could not resolve all files for configuration ':metadataCompileClasspath'.
> Could not resolve com.soywiz.korlibs.korma:korma:2.0.0.999.
Required by:
project :
> 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.soywiz.korlibs.korma:korma:2.0.0.999:
- iosArm32ApiElements-published
- iosArm64ApiElements-published
- iosSimulatorArm64ApiElements-published
- iosX64ApiElements-published
- jsApiElements-published
- jvmApiElements-published
- jvmRuntimeElements-published
- linuxX64ApiElements-published
- mingwX64ApiElements-published
All of them match the consumer attributes:
- Variant 'iosArm32ApiElements-published' capability com.soywiz.korlibs.korma:korma:2.0.0.999 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 'ios_arm32' but the consumer didn't ask for it
- Variant 'iosArm64ApiElements-published' capability com.soywiz.korlibs.korma:korma:2.0.0.999 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 'ios_arm64' but the consumer didn't ask for it
- Variant 'iosSimulatorArm64ApiElements-published' capability com.soywiz.korlibs.korma:korma:2.0.0.999 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 'ios_simulator_arm64' but the consumer didn't ask for it
- Variant 'iosX64ApiElements-published' capability com.soywiz.korlibs.korma:korma:2.0.0.999 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 'ios_x64' but the consumer didn't ask for it
- Variant 'jsApiElements-published' capability com.soywiz.korlibs.korma:korma:2.0.0.999 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 'jvmApiElements-published' capability com.soywiz.korlibs.korma:korma:2.0.0.999 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.soywiz.korlibs.korma:korma:2.0.0.999 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.soywiz.korlibs.korma:korma:2.0.0.999 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 'mingwX64ApiElements-published' capability com.soywiz.korlibs.korma:korma:2.0.0.999 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
The following variants were also considered but didn't match the requested attributes:
- Variant 'iosArm32MetadataElements-published' capability com.soywiz.korlibs.korma:korma:2.0.0.999 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.soywiz.korlibs.korma:korma:2.0.0.999 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.soywiz.korlibs.korma:korma:2.0.0.999 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.soywiz.korlibs.korma:korma:2.0.0.999 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 'jsRuntimeElements-published' capability com.soywiz.korlibs.korma:korma:2.0.0.999 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 'metadataApiElements' capability com.soywiz.korlibs.korma:korma:2.0.0.999 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)
> Could not resolve com.soywiz.korlibs.korio:korio:2.0.0.999.
Required by:
project :
> 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.soywiz.korlibs.korio:korio:2.0.0.999:
- iosArm32ApiElements-published
- iosArm64ApiElements-published
- iosSimulatorArm64ApiElements-published
- iosX64ApiElements-published
- jsApiElements-published
- jvmApiElements-published
- jvmRuntimeElements-published
- linuxX64ApiElements-published
- mingwX64ApiElements-published
All of them match the consumer attributes:
- Variant 'iosArm32ApiElements-published' capability com.soywiz.korlibs.korio:korio:2.0.0.999 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 'ios_arm32' but the consumer didn't ask for it
- Variant 'iosArm64ApiElements-published' capability com.soywiz.korlibs.korio:korio:2.0.0.999 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 'ios_arm64' but the consumer didn't ask for it
- Variant 'iosSimulatorArm64ApiElements-published' capability com.soywiz.korlibs.korio:korio:2.0.0.999 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 'ios_simulator_arm64' but the consumer didn't ask for it
- Variant 'iosX64ApiElements-published' capability com.soywiz.korlibs.korio:korio:2.0.0.999 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 'ios_x64' but the consumer didn't ask for it
- Variant 'jsApiElements-published' capability com.soywiz.korlibs.korio:korio:2.0.0.999 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 'jvmApiElements-published' capability com.soywiz.korlibs.korio:korio:2.0.0.999 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.soywiz.korlibs.korio:korio:2.0.0.999 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.soywiz.korlibs.korio:korio:2.0.0.999 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 'mingwX64ApiElements-published' capability com.soywiz.korlibs.korio:korio:2.0.0.999 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
The following variants were also considered but didn't match the requested attributes:
- Variant 'iosArm32MetadataElements-published' capability com.soywiz.korlibs.korio:korio:2.0.0.999 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.soywiz.korlibs.korio:korio:2.0.0.999 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.soywiz.korlibs.korio:korio:2.0.0.999 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.soywiz.korlibs.korio:korio:2.0.0.999 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 'jsRuntimeElements-published' capability com.soywiz.korlibs.korio:korio:2.0.0.999 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 'metadataApiElements' capability com.soywiz.korlibs.korio:korio:2.0.0.999 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)
* 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.
Here's what my build.gradle.kts looks like:
val main_class = "CoolMainKt"
project.setProperty("mainClassName", main_class)
plugins {
kotlin("multiplatform") version "1.6.10"
kotlin("plugin.serialization") version "1.6.10"
id("maven-publish")
id("org.jetbrains.kotlin.plugin.allopen") version "1.6.0"
id("org.jetbrains.kotlinx.benchmark") version "0.4.2"
application
}
application {
mainClass.set(main_class)
}
allOpen {
annotation("org.openjdk.jmh.annotations.State")
}
group = "com.xenotactic.gamelogic"
version = "1.0.0"
repositories {
mavenCentral()
mavenLocal()
google()
maven { url = uri("https://plugins.gradle.org/m2/") }
}
//val korgeVersion = "2.7.0"
val korgeVersion = "2.0.0.999"
val gitliveVersion = "1.4.3"
val ktorVersion = "2.0.1"
kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
withJava()
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
js(IR) {
browser {
commonWebpackConfig {
cssSupport.enabled = true
}
}
}
val hostOs = System.getProperty("os.name")
val isMingwX64 = hostOs.startsWith("Windows")
val nativeTarget = when {
hostOs == "Mac OS X" -> macosX64("native")
hostOs == "Linux" -> linuxX64("native")
isMingwX64 -> mingwX64("native")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}
sourceSets {
val commonMain by getting {
dependencies {
implementation("com.soywiz.korlibs.korma:korma:$korgeVersion")
implementation("com.soywiz.korlibs.korio:korio:$korgeVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.3.2")
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.6.10")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("org.jetbrains.kotlinx:kotlinx-benchmark-runtime:0.4.2")
implementation("com.google.firebase:firebase-admin:8.1.0")
compileOnly("com.google.api-client:google-api-client:1.31.5")
// implementation("io.ktor:ktor-client-cio:$ktorVersion")
// implementation("com.google.firebase:firebase-database-ktx:20.0.4")
// implementation("dev.gitlive:firebase-app:$gitliveVersion")
// implementation("dev.gitlive:firebase-common:$gitliveVersion")
// implementation("dev.gitlive:firebase-firestore:$gitliveVersion")
// implementation("dev.gitlive:firebase-auth:$gitliveVersion")
// implementation("dev.gitlive:firebase-database:$gitliveVersion")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val jvmMain by getting {
dependencies {
implementation("io.ktor:ktor-client-cio-jvm:$ktorVersion")
}
}
val jvmTest by getting
val jsMain by getting {
dependencies {
// implementation("io.ktor:ktor-client-cio-js:$ktorVersion")
implementation("io.ktor:ktor-client-js:$ktorVersion")
}
}
val jsTest by getting
val nativeMain by getting {
dependencies {
implementation("io.ktor:ktor-client-curl:$ktorVersion")
}
}
val nativeTest by getting
}
}
benchmark {
targets {
register("jvm")
}
}
Upvotes: 0
Views: 1100
Reputation: 61
Update: I finally got it to work after splitting the ktor io/client stuff to it's own kotlin MPP library and updating to the latest kotlin version. Here's the updated gradle file:
val main_class = "CoolMainKt"
project.setProperty("mainClassName", main_class)
plugins {
kotlin("multiplatform") version "1.7.0-RC"
kotlin("plugin.serialization") version "1.6.21"
id("maven-publish")
id("org.jetbrains.kotlin.plugin.allopen") version "1.6.0"
id("org.jetbrains.kotlinx.benchmark") version "0.4.2"
application
}
application {
mainClass.set(main_class)
}
allOpen {
annotation("org.openjdk.jmh.annotations.State")
}
group = "com.xenotactic.gamelogic"
version = "1.0.0"
repositories {
mavenCentral()
mavenLocal()
google()
maven { url = uri("https://plugins.gradle.org/m2/") }
}
//val korgeVersion = "2.7.0"
val korgeVersion = "2.0.0.999"
val gitliveVersion = "1.4.3"
val ktorVersion = "2.0.1"
kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
withJava()
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
js(IR) {
browser {
commonWebpackConfig {
cssSupport.enabled = true
}
}
}
val hostOs = System.getProperty("os.name")
val isMingwX64 = hostOs.startsWith("Windows")
val nativeTarget = when {
hostOs == "Mac OS X" -> macosX64("native")
hostOs == "Linux" -> linuxX64("native")
isMingwX64 -> mingwX64("native")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}
sourceSets {
val commonMain by getting {
dependencies {
implementation("com.soywiz.korlibs.korma:korma:$korgeVersion")
implementation("com.soywiz.korlibs.korio:korio:$korgeVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.3.2")
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.6.10")
implementation("org.jetbrains.kotlinx:kotlinx-benchmark-runtime:0.4.2")
// implementation("io.ktor:ktor-client-core:$ktorVersion")
// implementation("com.google.firebase:firebase-admin:8.1.0")
// compileOnly("com.google.api-client:google-api-client:1.31.5")
// implementation("io.ktor:ktor-client-cio:$ktorVersion")
// implementation("com.google.firebase:firebase-database-ktx:20.0.4")
// implementation("dev.gitlive:firebase-app:$gitliveVersion")
// implementation("dev.gitlive:firebase-common:$gitliveVersion")
// implementation("dev.gitlive:firebase-firestore:$gitliveVersion")
// implementation("dev.gitlive:firebase-auth:$gitliveVersion")
// implementation("dev.gitlive:firebase-database:$gitliveVersion")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val jvmMain by getting {
dependencies {
// implementation("io.ktor:ktor-client-cio-jvm:$ktorVersion")
}
}
val jvmTest by getting
val jsMain by getting {
dependencies {
// implementation("io.ktor:ktor-client-cio-js:$ktorVersion")
// implementation("io.ktor:ktor-client-js:$ktorVersion")
}
}
val jsTest by getting
val nativeMain by getting {
dependencies {
// implementation("io.ktor:ktor-client-curl:$ktorVersion")
}
}
val nativeTest by getting
}
}
benchmark {
targets {
register("jvm")
}
}
Upvotes: 0