Hi, all, I am trying to use coil3 in linux, and I ...
# multiplatform
a
Hi, all, I am trying to use coil3 in linux, and I have a weird error requiring android coroutine dispachers
Copy code
implementation("io.coil-kt.coil3:coil-core-jvm:3.0.0-alpha06")
implementation("io.coil-kt.coil3:coil-svg:3.0.0-alpha06")
implementation("io.coil-kt.coil3:coil-compose:3.0.0-alpha06")
Copy code
val painter = rememberAsyncImagePainter(
    model = ImageRequest.Builder(PlatformContext.INSTANCE)
        .data(svgPath)
        .decoderDispatcher(Dispatchers.Main)
        .interceptorDispatcher(Dispatchers.Main)
        .fetcherDispatcher(<http://Dispatchers.IO|Dispatchers.IO>)
        .dispatcher(Dispatchers.Main)
        .size(Size.ORIGINAL)
        .build()
)

Image(
    painter = painter,
    contentDescription = null,
    modifier = Modifier.fillMaxSize(),
    contentScale = ContentScale.Fit
)
error: Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android' and ensure it has the same version as 'kotlinx-coroutines-core'
any ideas?
c
There should be a
kotlinx-coroutines-swing
for compose desktop applications.
🙌 1
❤️ 1
c
yeah this is the same issue as something else lemme find the ticket for you
Oh I mean the swing thing might have fixed it if not then there is this: https://github.com/Kotlin/kotlinx.coroutines/issues/3914
But hopefully the swing dep fixes it