在视图模型中使用如下所示的接口时 class MainViewModel @ViewModelInject constructor() : ViewModel() 我收到如下错误 cannot be provided without an @Provides-annotatedpublic abstract static class SingletonC implements Main
Hilt指出,如果没有@Provides注释,就不能提供这个接口: fun getAllLists(): LiveData<List完整的错误消息:
AndroidStudioProjects\PlanShopping\app\build\generated\hilt\component_sources\debug\com\tetsoftcannot be provided without
kotlin.UninitializedPropertyAccessException: lateinit property repository has not been initialized in MyViewModel}
@InstallIn(ApplicationComponent::class) @Provides