3

I am trying to import the coil image library inside a composable function using import coil.compose.AsyncImage and implementation("io.coil-kt:coil:2.2.2") but Android Studio can't recognize the 'compose' and returns

Unresolved reference: compose

I tried to invalidate the caches and clean the project with no change happened I use Android Studio Dolphin | 2021.3.1 where:

compose_ui_version = '1.2.1'

composeOptions {
    kotlinCompilerExtensionVersion '1.3.1'
}

compileSdk 33
gradle 7.4
Orwa kassab
  • 111
  • 1
  • 9

2 Answers2

0

To use coil library with jetback compose you gotta use the coil-compose dependency.

In your build.gradle

change this implementation("io.coil-kt:coil:2.2.2")

to this implementation("io.coil-kt:coil-compose:2.4.0")

0
implementation "io.coil-kt:coil-compose:1.4.0"
Falcon.9r
  • 1
  • 1
  • 1
    Answer needs supporting information Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](https://stackoverflow.com/help/how-to-answer). – moken Jul 22 '23 at 09:27