Didier Villevalois
11/19/2021, 2:45 PMktor-io
and ktor-network
as implementation dependencies for my common
source set, I now have an error "Could not resolve io.ktorktor io2.0.0-SNAPSHOT" that I don't understand. I found lots of similar errors in the Slack search but none hints me at what the problem is. This was working fine when I was using ktor 1.6.4-SNAPSHOT and Kotlin 1.5.31.
(Gradle configuration and full error in thread.)
Does anyone know what can be the problem ? Thanks in advance for you help.val kotlinxCoroutinesVersion: String by project
val ktorVersion: String by project
val mingwPath = File(System.getenv("MINGW64_DIR") ?: "C:/msys64/mingw64")
kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
val hostOs = System.getProperty("os.name")
val hostTarget = when {
hostOs == "Mac OS X" -> macosX64("native")
hostOs == "Linux" -> linuxX64("native") {
binaries.sharedLib()
}
hostOs.startsWith("Windows") -> mingwX64("native")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}
sourceSets {
all {
languageSettings.optIn("kotlin.RequiresOptIn")
languageSettings.optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
}
val commonMain by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion")
implementation("io.ktor:ktor-io:$ktorVersion")
implementation("io.ktor:ktor-network:$ktorVersion")
implementation(project(":ktzmq-core"))
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val jvmMain by getting
val nativeMain by getting
}
}
> Error while evaluating property 'filteredArgumentsMap' of task ':ktzmq-cio:compileKotlinMetadata'
> Could not resolve all files for configuration ':ktzmq-cio:metadataCompileClasspath'.
> Could not resolve io.ktor:ktor-io:2.0.0-SNAPSHOT.
Required by:
project :ktzmq-cio
> The consumer was configured to find a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common'. However we cannot choose between the following variants of io.ktor:ktor-io:2.0.0-SNAPSHOT:
- iosArm32ApiElements-published
- iosArm64ApiElements-published
- iosSimulatorArm64ApiElements-published
- iosX64ApiElements-published
- jsIrApiElements-published
- jsLegacyApiElements-published
- jvmApiElements-published
- jvmRuntimeElements-published
- linuxX64ApiElements-published
- macosArm64ApiElements-published
- macosX64ApiElements-published
- mingwX64ApiElements-published
- tvosArm64ApiElements-published
- tvosSimulatorArm64ApiElements-published
- tvosX64ApiElements-published
- watchosArm32ApiElements-published
- watchosArm64ApiElements-published
- watchosSimulatorArm64ApiElements-published
- watchosX64ApiElements-published
- watchosX86ApiElements-published
All of them match the consumer attributes:
- Variant 'iosArm32ApiElements-published' capability io.ktor:ktor-io:2.0.0-SNAPSHOT declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
- Unmatched attributes:
- Provides integration 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 io.ktor:ktor-io:2.0.0-SNAPSHOT declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
- Unmatched attributes:
- Provides integration 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
[...+
Aleksei Tirman [JB]
11/19/2021, 5:12 PM2.0.0-eap-267
from https://maven.pkg.jetbrains.space/public/p/ktor/eap repository?Didier Villevalois
11/21/2021, 11:22 AM2.0.0-eap-267
then my build fails with missing symbols (from the PR I am trying to test). It looks like publishToMavenLocal
does not publish all the artifacts.Aleksei Tirman [JB]
11/22/2021, 6:25 PMDidier Villevalois
11/24/2021, 10:26 PMAleksei Tirman [JB]
11/25/2021, 8:05 AMmain
branch :)Didier Villevalois
11/25/2021, 7:09 PMcompileKotlinMetada
. After a clean of my project (this sub-project targets JVM and Native), the build phases applied in order are:
• compileCommonMainKotlinMetadata
✅
• compileKotlinLinuxX64
✅
• compileKotlinJVM
✅
• linkDebugSharedLinuxX64
✅
• linkReleaseSharedLinuxX64
✅
• compileKotlinMetadata
❌
I have errors like:
e: /home/didier/Code/Didier/ktzmq/ktzmq-cio/src/commonMain/kotlin/org/zeromq/CIOInstance.kt: (3, 8): Unresolved reference: io
e: /home/didier/Code/Didier/ktzmq/ktzmq-cio/src/commonMain/kotlin/org/zeromq/CIOInstance.kt: (4, 8): Unresolved reference: io
e: /home/didier/Code/Didier/ktzmq/ktzmq-cio/src/commonMain/kotlin/org/zeromq/CIOInstance.kt: (16, 12): Unresolved reference: InternalAPI
e: /home/didier/Code/Didier/ktzmq/ktzmq-cio/src/commonMain/kotlin/org/zeromq/CIOInstance.kt: (16, 12): An annotation argument must be a compile-time constant
e: /home/didier/Code/Didier/ktzmq/ktzmq-cio/src/commonMain/kotlin/org/zeromq/CIOInstance.kt: (17, 35): Unresolved reference: SelectorManager
[...]
I can't figure out what is the problem nor can I find an related issue in YouTrack...Aleksei Tirman [JB]
11/26/2021, 7:47 AM~/.m2
and ~/.gradle
directories completely)Didier Villevalois
11/26/2021, 10:03 AM~/.m2
and ~/.gradle
, then ./gradlew publishToMavenLocal
in Ktor, and then ./gradlew assemble
in my project. I unfortunately obtain the exact same errors.