Getting "None of the following candidates is applicable" when trying to use LiveData list in itemsIndexed in LazyColumn
20:30 30 Dec 2025

Relvant code in ViewModel:

    val allFoods: LiveData> = repository.allFoods.asLiveData()

and MainActivity:

    val foods = foodViewModel.allFoods.observeAsState(listOf())

    LazyColumn(modifier = Modifier.fillMaxSize()) {
        itemsIndexed(foods) // "None of the following candidates is applicable"
    }

I've tried using "items" and manually importing:

import androidx.compose.foundation.lazy.items

...but it would not pick up the import at all.

How do I fix this?

kotlin android-jetpack-compose viewmodel android-livedata