v

    Vivek Modi

    5 months ago
    Hey I am importing darwin in Kmm
    build.gradle.kts
    . I tried to import code in class but it giving error. Can someone guide me.
    plugins {
        kotlin("multiplatform")
        kotlin("native.cocoapods")
        id("com.android.library")
    }
    
    version = "1.0"
    
    kotlin {
        android()
        iosX64()
        iosArm64()
        iosSimulatorArm64()
    
        cocoapods {
            summary = "Some description for the Shared Module"
            homepage = "Link to the Shared Module homepage"
            ios.deploymentTarget = "14.1"
            framework {
                baseName = "kotlinmultiplatformsharedmodule"
            }
        }
    
        sourceSets {
            val commonMain by getting {
                dependencies {
                    implementation("io.ktor:ktor-client-core:2.0.0")
                    implementation("io.ktor:ktor-client-logging:2.0.0")
                    implementation("io.insert-koin:koin-core:3.2.0-beta-1")
                }
            }
            val commonTest by getting {
                dependencies {
                    implementation(kotlin("test"))
                }
            }
            val androidMain by getting {
                dependencies {
                    implementation("io.ktor:ktor-client-okhttp:2.0.0")
                }
            }
            val androidTest by getting
            val iosX64Main by getting
            val iosArm64Main by getting
            val iosSimulatorArm64Main by getting
            val iosMain by creating {
                dependsOn(commonMain)
                iosX64Main.dependsOn(this)
                iosArm64Main.dependsOn(this)
                iosSimulatorArm64Main.dependsOn(this)
                dependencies {
                    implementation("io.ktor:ktor-client-darwin:2.0.0")
                }
            }
            val iosX64Test by getting
            val iosArm64Test by getting
            val iosSimulatorArm64Test by getting
            val iosTest by creating {
                dependsOn(commonTest)
                iosX64Test.dependsOn(this)
                iosArm64Test.dependsOn(this)
                iosSimulatorArm64Test.dependsOn(this)
            }
        }
    }
    
    android {
        compileSdk = 32
        sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
        defaultConfig {
            minSdk = 21
            targetSdk = 32
        }
    }
    Konstantin Tskhovrebov

    Konstantin Tskhovrebov

    5 months ago
    try to use
    io.ktor:ktor-client-ios:2.0.0
    and what is your Kotlin version?
    v

    Vivek Modi

    5 months ago
    According to this docs it change to darwin. I followed this Kmm-config. why it's different?
    my kotlin version is 1.6.20
    I used invalidate and restart It working fine
    Konstantin Tskhovrebov

    Konstantin Tskhovrebov

    5 months ago
    v

    Vivek Modi

    5 months ago
    thanks a million