이슈
Image loading error😂 Coil 라이브러리로 테스트 하는 도중 네트워크를 통한 이미지 로딩이 불가한 이슈가 계속 발생했다. Jira에서 제공하는 API를 보고있었다. 계정 프로필 이미지를 가져오는 테스트였다. 😎
해결
Coil로 네트워크 이미지를 가져오려면 dependency를 몇 개 더 추가해야한다.
참고 URL: https://coil-kt.github.io/coil/network/#network-images
Network Images
By default, Coil 3.x does not include support for loading images from the network. This is to avoid forcing a large networking dependency on users who want to use their own networking solution or do not need network URL support (e.g. only loading images from disk).
To add support for fetching images from the network import only one of the following:
implementation("io.coil-kt.coil3:coil-network-okhttp:3.1.0") // Only available on Android/JVM.
implementation("io.coil-kt.coil3:coil-network-ktor2:3.1.0")
implementation("io.coil-kt.coil3:coil-network-ktor3:3.1.0")
If you use OkHttp, that's it. Once imported, network URLs like https://example.com/image.jpg will automatically be supported. If you use Ktor, you need to add supported engines for each platform (see below).
'Android Compose' 카테고리의 다른 글
Android Compose Slot API란? (0) | 2024.08.12 |
---|---|
Composable functions with non-default parameters are not supported in Preview unless they are annotated with @PreviewParameter (0) | 2024.07.14 |
XML에서 Compose로 마이그레이션 gradle 세팅하기 (feat. BOM이란?) (0) | 2024.07.14 |
선언형이란? (1) | 2024.07.13 |
Android 컴포즈를 쓰는 이유는? (1) | 2024.07.13 |