Rohit Neel
04/24/2025, 1:19 PMAsyncImage
composable in the commonMain
package of a Kotlin Multiplatform project to load an image from a URL? I tried using it, but AsyncImage
is not accessible in commonMain
composable functions.
Do we need to use `expect`/`actual` declarations to support image loading on both Android and iOS platforms?Michael Krussel
04/24/2025, 1:41 PMcommonMain
source set?Rohit Neel
04/24/2025, 1:43 PMcoil-compose = { group = "io.coil-kt.coil3", name = "coil-compose", version.ref = "coil"}
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.kotlinx.coroutines)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.coil.compose)
}
Michael Krussel
04/24/2025, 1:45 PMRohit Neel
04/24/2025, 1:47 PMRohit Neel
04/24/2025, 1:48 PMMichael Krussel
04/24/2025, 1:48 PMMichael Krussel
04/24/2025, 1:49 PMRohit Neel
04/24/2025, 1:54 PMMichael Krussel
04/24/2025, 1:54 PMRohit Neel
04/24/2025, 1:55 PMRohit Neel
04/24/2025, 1:55 PM