coil-kt / coil

Image loading for Android and Compose Multiplatform.
https://coil-kt.github.io/coil/
Apache License 2.0
10.84k stars 665 forks source link

iosArm64Main: Could not find io.coil-kt.coil3:coil-network-ktor:3.0.0-rc01 #2544

Closed ashrafkm closed 1 month ago

ashrafkm commented 1 month ago

I am using compose multiplatform I'm currently working on a project using Compose Multiplatform project, and looking for ways to handle image loading from a URL. while sync, I get an error is

Error: composeApp:iosArm64Main: Could not find io.coil-kt.coil3:coil-network-ktor:3.0.0-rc01. Required by: project :composeApp

my files libs.versions.toml

[versions]
kotlin = "2.0.20"
coil = "3.0.0-rc01"
ktor = "3.0.0"

[libraries]
ktor-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" }
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" }
ktor-client-curl = { module = "io.ktor:ktor-client-curl", version.ref = "ktor" }
ktor-client-winhttp = { module = "io.ktor:ktor-client-winhttp", version.ref = "ktor" }
coil-compose = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coil" }
coil-compose-core = { module = "io.coil-kt.coil3:coil-compose-core", version.ref = "coil" }
coil-network-ktor = { module = "io.coil-kt.coil3:coil-network-ktor", version.ref = "coil" }
coil-mp = { module = "io.coil-kt.coil3:coil", version.ref = "coil" }

gradle file

    sourceSets {

        androidMain.dependencies {
            implementation(compose.preview)
            implementation(libs.androidx.activity.compose)

            //coil
            implementation(libs.ktor.client.okhttp)

        }

        iosMain.dependencies {

            //coil
            implementation(libs.ktor.client.darwin)
        }

        commonMain.dependencies {
            implementation(compose.runtime)
            implementation(compose.foundation)
            implementation(compose.material)
            implementation(compose.ui)
            implementation(compose.components.resources)
            implementation(compose.components.uiToolingPreview)
            implementation(libs.androidx.lifecycle.viewmodel)
            implementation(libs.androidx.lifecycle.runtime.compose)

            //coil
            implementation(libs.ktor.core)
            implementation(libs.coil.compose.core)
            implementation(libs.coil.mp)
            implementation(libs.coil.network.ktor)
            implementation(libs.coil.compose)
        }
    }
colinrtwhite commented 1 month ago

We had to split coil-network-ktor to support both Ktor 2 and Ktor 3. You'll need to import io.coil-kt.coil3:coil-network-ktor3:3.0.0-rc01 to use Ktor 3.