<why Cannot create an instance of class Viewmodel?...
# stackoverflow
r
why Cannot create an instance of class Viewmodel? i was making a View model class ShopViewModel : AndroidViewModel(Application()) { private val jsonFileString = getJsonDataFromAsset(getApplication().baseContext, "Store.json") var items by mutableStateOf(ShopItemsRepo.getItems(jsonFileString)) fun deleteItem(shopItem: ShopItem){ items = items.toMutableList().also { it.remove(shopItem) } } } and this view model is taking json file for data (read if you need): data class ShopItem(val name:String,...