Type 'State?>' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate

前端 未结 4 1189
我寻月下人不归
我寻月下人不归 2021-02-13 02:53

I\'m trying to get a value from LiveData with observeAsState in jetpack compose, but I get a weird error

Type \'State\' has no method \'getValue

4条回答
  •  一向
    一向 (楼主)
    2021-02-13 03:34

    In my case, in a compose application it was this missing import that provoc the error

    import androidx.compose.getValue

提交回复
热议问题