-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Hilt] FR: Create a HiltComponentActivity artifact #3394
Comments
Hi I take it same issue This issue reason implementation "androidx.hilt:hilt-navigation-compose:$hiltComposeNavigation" |
Just leaving some info. We have wanted to create an convenient Hilt test activity but have been blocked on https://b.corp.google.com/issues/127986458. I don't think we're keen on using the workaround for this though as this is a convenience thing (since you can always define your own simple Hilt test activity) and not actually blocking. |
I cannot access https://b.corp.google.com/issues/127986458 since is private. So what's its status? |
When creating Compose tests, it's very common to start an empty ComponentActivity so that you can set the content later:
However, this test crashes* because
ComponentActivity
is not annotated for Hilt. The workaround is to create aHiltComponentActivity
indebug/
and add it to the manifest, which is not ideal.We solved a very similar issue for Compose Testing already with the
ui-test-manifest
artifact:https://maven.google.com/web/index.html?q=manifest#androidx.compose.ui:ui-test-manifest:1.2.0-beta01
which is installed in the debug sourceset:
For consistency, the new artifact could be called
ui-test-hilt-manifest
.The text was updated successfully, but these errors were encountered: