You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.IllegalStateException: Given component holder class dev.testify.ComposableTestActivity 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:206)
at dagger.hilt.android.internal.lifecycle.HiltViewModelFactory.createInternal(HiltViewModelFactory.java:200)
at androidx.hilt.navigation.HiltViewModelFactory.create(HiltNavBackStackEntry.kt:77)
at androidx.hilt.navigation.compose.HiltViewModelKt.createHiltViewModelFactory(HiltViewModel.kt:57)
There also needs to be a subclass of ComposableScreenshotRule which uses the Activity created in the previous step.
So, for now, I think the only way around this in Testify 2.0 would be for you to duplicate the code in ComposableScreenshotRule and create your own version of it that uses a ComponentActivity instead of the hardcoded ComposableTestActivity.
Otherwise, this will have to be fixed in a future version of Testify.
Describe the bug
When using HiltAndroidRule from Dagger/Hilt 2.49+ with Testify, an
IllegalStateException
is thrown.This issue relates to:
To Reproduce
Related issue in Dagger: google/dagger#3394
Example workaround:
https://github.com/android/nowinandroid/blob/main/ui-test-hilt-manifest/src/main/kotlin/com/google/samples/apps/nowinandroid/uitesthiltmanifest/HiltComponentActivity.kt
The text was updated successfully, but these errors were encountered: