Hey Team,, I tried to work with KMP project with p...
# eap
c
Hey Team,, I tried to work with KMP project with plugin version: 1.4-M2 I am trying to create a service layer with ktor version: 1.3.2-1.4-M2 But it couldn’t find any modules of ktor of this version:
Copy code
plugins {
    kotlin("multiplatform") version "1.4-M2"
}
group = "dev.chintansoni"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
    maven {
        url = uri("<https://dl.bintray.com/kotlin/kotlin-eap>")
    }
    maven {
        url = uri("<https://kotlin.bintray.com/ktor>")
    }
}
kotlin {
    jvm {
        compilations.all {
            kotlinOptions.jvmTarget = "1.8"
        }
    }
    js {
        nodejs()
        browser()
    }
    val hostOs = System.getProperty("os.name")
    val isMingwX64 = hostOs.startsWith("Windows")
    val nativeTarget = when {
        hostOs == "Mac OS X" -> macosX64("native") {
            binaries.framework {
                baseName = "MacOSDomain"
            }
        }
        hostOs == "Linux" -> linuxX64("native")
        isMingwX64 -> mingwX64("native")
        else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
    }

    sourceSets {
        val ktorVersion = "1.3.2-1.4-M2"
        val commonMain by getting {
            dependencies {
                implementation(kotlin("stdlib-common"))
                implementation("io.ktor:ktor-client-core:$ktorVersion")
                implementation("io.ktor:ktor-client-json:$ktorVersion")
                implementation("io.ktor:ktor-client-logging:$ktorVersion")
                implementation("io.ktor:ktor-client-serialization:$ktorVersion")
            }
        }
        val commonTest by getting {
            dependencies {
                implementation(kotlin("test-common"))
                implementation(kotlin("test-annotations-common"))
            }
        }
        val jvmMain by getting {
            dependencies {
                implementation(kotlin("stdlib-jdk8"))
            }
        }
        val jvmTest by getting {
            dependencies {
                implementation(kotlin("test-junit"))
            }
        }
        val jsMain by getting {
            dependencies {
                implementation(kotlin("stdlib-js"))
            }
        }
        val jsTest by getting {
            dependencies {
                implementation(kotlin("test-js"))
            }
        }
        val nativeMain by getting {}
        val nativeTest by getting {}
    }
}
It gives me error:
Copy code
Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7-1.4-M2
Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0-1.4-M2
Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7-1.4-M2
Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0-1.4-M2
Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7-1.4-M2
Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0-1.4-M2
Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7-1.4-M2
Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0-1.4-M2
Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7-1.4-M2
Could not resolve org.jetbrains.kotlinx:atomicfu:0.14.3-1.4-M2
Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0-1.4-M2
Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7-1.4-M2
Could not resolve org.jetbrains.kotlinx:atomicfu:0.14.3-1.4-M2
Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0-1.4-M2
Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7-1.4-M2
Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0-1.4-M2
Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7-1.4-M2
Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0-1.4-M2
Can someone please help me with it?
n
👍 2
c
@Nikky okay let me try. I will update you on this.
n
also to create output you might need
Copy code
binaries.executable()
in the js block
✔️ 1
c
@Nikky Thanks a ton! It worked.