After update some library in Jetpack Compose, I got this issue when run preview
java.lang.IllegalStateException: Given component holder class androidx.compose.ui.tooling.PreviewActivity does not implement interface dagger.hilt.internal.GeneratedComponent or interface dagger.hilt.internal.GeneratedComponentManager at dagger.hilt.EntryPoints.get(EntryPoints.java:62) at dagger.hilt.android.internal.lifecycle.HiltViewModelFactory.createInternal(HiltViewModelFactory.java:149) at dagger.hilt.android.internal.lifecycle.HiltViewModelFactory.createInternal(HiltViewModelFactory.java:143)
My Screen PreView :
@Preview
@Composable
fun CatalogOverviewScreenPreview() {
JetpackComposeCatalogTheme {
CatalogOverviewRoute({})
}
}
My screen with hilt ViewModel :
@Composable
fun CatalogOverviewRoute(
navigateCatalogDetail: (CatalogComposeEnum) -> Unit,
viewModel: CatalogOverviewViewModel = hiltViewModel()
) {
val catalogList by viewModel.catalogOverViewGroupList.collectAsStateWithLifecycle()
CatalogOverviewScreen(catalogList, navigateCatalogDetail, viewModel::updateExpand)
}
Did anyone get this issue after update version compose library and how you guys fixed it ? Thank a lot
I want to preview normally without issue