Hi, just tried to use 1.2.0 ktor and got gradle er...
# ktor
a
Hi, just tried to use 1.2.0 ktor and got gradle error: > Could not find io.ktorktor client websocket1.2.0. How can I fix this?
e
Hi @Antanas A., could you provide your gradle configuration?
btw:
ktor-client-websocket
is part of
ktor-client-core
now
a
My gradle:
Copy code
buildscript {
    ext {
        kotlinVersion = '1.3.21'
        coroutinesVersion = '1.1.1'
        ktorVersion = '1.2.0'
    }
    repositories {
        jcenter()
        mavenCentral()
        maven { url '<https://kotlin.bintray.com/kotlinx>' }
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
    }
}
repositories {
    jcenter()
    maven { url '<https://kotlin.bintray.com/kotlinx>' }
    maven { url '<https://kotlin.bintray.com/kotlin-eap>' }
}

kotlin {
    targets {
        fromPreset(presets.jvm, 'jvm') {
            compilations.all {
                tasks[compileKotlinTaskName].kotlinOptions.jvmTarget = '1.6'
            }
        }
        fromPreset(project.hasProperty('iosDevice') ? presets.iosArm64 : presets.iosX64, 'ios') {
            compilations.main.outputKinds 'framework'
        }
    }
    sourceSets {
        all {
            languageSettings {
                useExperimentalAnnotation 'kotlin.contracts.ExperimentalContracts'
                useExperimentalAnnotation 'kotlinx.coroutines.ExperimentalCoroutinesApi'
                useExperimentalAnnotation 'kotlinx.coroutines.ObsoleteCoroutinesApi'
                useExperimentalAnnotation 'kotlinx.serialization.ImplicitReflectionSerializer'
                useExperimentalAnnotation 'kotlinx.coroutines.InternalCoroutinesApi'
            }
        }
        commonMain {
            kotlin.srcDirs = ['common/src/main/kotlin']
            dependencies {
                implementation "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinVersion"
                implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutinesVersion"
                implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serializationVersion"
                implementation "org.jetbrains.kotlinx:kotlinx-io:$kotlinxIoVersion"
            }
        }
        commonTest {
            kotlin.srcDirs = ['common/src/test/kotlin']
            dependencies {
                implementation "org.jetbrains.kotlin:kotlin-test-common:$kotlinVersion"
                implementation "org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlinVersion"
            }
        }
        jvmMain {
            kotlin.srcDirs = ['jvm/src/main/kotlin']
            languageSettings {
                useExperimentalAnnotation 'io.ktor.util.KtorExperimentalAPI'
                useExperimentalAnnotation 'io.ktor.util.InternalAPI'
                useExperimentalAnnotation 'io.ktor.http.cio.websocket.WebSocketInternalAPI'
            }
            dependencies {
                implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
                implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"
                implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$serializationVersion"
                implementation "io.ktor:ktor-client-websocket:$ktorVersion"
                implementation "commons-codec:commons-codec:$commonsCodec"
                implementation 'joda-time:joda-time:2.10'
                implementation "org.jetbrains.kotlinx:kotlinx-io-jvm:$kotlinxIoVersion"
            }
        }
       
    }
}
e
@cy
a
or should I add "-rc2" and use "1.2.0-rc2" instead?
🚫 1
m
note that it’s
ktor-client-websockets
plural not singular
a
oh it was renamed from ktor-client-websocket to ktor-client-websockets