Код: Выделить всё
java.lang.IllegalStateException: Unable to create a fetcher that supports: https://img.freepik.com/free-vector/smiling-young-man-illustration_1308-174669.jpg
at coil3.intercept.EngineInterceptor.fetch(EngineInterceptor.kt:153)
at coil3.intercept.EngineInterceptor.execute(EngineInterceptor.kt:115)
at coil3.intercept.EngineInterceptor.access$execute(EngineInterceptor.kt:32)
at coil3.intercept.EngineInterceptor$intercept$2.invokeSuspend(EngineInterceptor.kt:66)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:823)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)
Код: Выделить всё
@Composable
fun NewConversationsScreen(state: NewConversationState, modifier: Modifier = Modifier) {
when {
state.isLoading -> {
CircularProgressIndicator()
}
state.error != null -> {
Text(text = state.error)
}
else -> {
LazyColumn(
modifier = modifier.fillMaxSize()
) {
Log.d("NewConvScreen", "Users are : ${state.users.users}")
items(state.users.users) { user ->
val painter = rememberAsyncImagePainter(
model = user.photo
?: "https://plus.unsplash.com/premium_photo-1683865776032-07bf70b0add1?q=80&w=1932&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
)
Row(
modifier = Modifier.padding(16.dp).fillMaxWidth(),
horizontalArrangement = Arrangement.Start,
verticalAlignment = Alignment.CenterVertically
) {
//Profile Photo
Box(
modifier = Modifier
.size(40.dp)
.clip(RoundedCornerShape(32.dp))
.border(1.dp, Color.Black, RoundedCornerShape(32.dp))
) {
androidx.compose.foundation.Image(
painter = painter,
contentDescription = "Profile Photo",
modifier = Modifier.fillMaxSize()
)
}
Spacer(modifier = Modifier.width(16.dp))
Text(text = user.name ?: "No Name")
}
}
}
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... -correctly
Мобильная версия