0

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 error

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

toml version file

[version]
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" }

here is my gradle

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)
        }
    }

Can any one tell me what is wring here.

2 Answers 2

0

It's because of the version numbers on Maven. The other libraries you are importing are at 3.0.0-rc01, but the most recent version available for io.coil-kt.coil3:coil-network-ktor is 3.0.0-alpha08. If you update your toml with

[version]
...
coil-network = "3.0.0-alpha08"

and change your coil-network-ktor library to

coil-network-ktor = { module = "io.coil-kt.coil3:coil-network-ktor", version.ref = "coil-network" }

it should fix the issue.

Sign up to request clarification or add additional context in comments.

1 Comment

Didn't fix for me
0

I didn't find what is wrong in your code, max is what I feel is wrong is

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

    //coil
    implementation("io.ktor:ktor-client-darwin:3.0.0")

in iosMain these two are the same.

I can share my dependencies I have no issue with loading.

androidMain.dependencies {
       .....
        implementation(libs.ktor.client.android)
    }
commonMain.dependencies {
        ...
        implementation(libs.coil)
        implementation(libs.coil.compose)
        implementation(libs.coil.ktor)
    }
iosMain.dependencies {
        implementation(libs.ktor.client.darwin)
    }

5 Comments

I updated my description with full details and error, can you check please. Thanks
also can you show your version.toml file and gradle file
coil = "3.0.0-alpha06" #COIL coil = { module = "io.coil-kt.coil3:coil", version.ref = "coil" } 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-ktor = { module = "io.coil-kt.coil3:coil-network-ktor", version.ref = "coil" } coil-compose-core hasn't been used
Could you tell me how did u get this implementation(libs.ktor.client.android) Its not mentioned in toml file. Also please look into my question. I updated full description
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" } ktor-client-android = { module = "io.ktor:ktor-client-android", version.ref = "ktor" } ktor-serialization-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" } ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" } all ktor dependencies

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.