-
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
Dagger Hilt doesn't work with Dynamic Feature Modules. #1865
Comments
From https://dagger.dev/api/2.28/dagger/hilt/android/HiltAndroidApp.html
Given that dynamic feature modules aren't dependencies of the application, seems like it's a no-go, at least for now. |
Just FYI, we're going to come back to this issue about Hilt after the official launch. Thanks for filing it though and sorry for the wait! |
Thank you. I'm really looking forward to it! |
@yamasa can you try this? #970 (comment) I am not using it with dynamic features yet. But I am not implementing my data module in the app module (I have another module for the di stuff) and it is working for me (Android Gradle plugin 4.0.0 and kotlin 1.4-M2) |
I tried and it is not working for fragments too |
I think this is a design issue of Dagger Hilt. Hilt uses a monolithic component system. |
There's documentation on Hilt and DFM now at https://developer.android.com/training/dependency-injection/hilt-multi-module#dfm In general though, because we're built off of subcomponents and monolithic components you won't be able to use the standard Hilt mechanisms like |
Hmmm, too bad. @Chang-Eric |
Unfortunately, no. |
Thanks for your comments. In summary, I updated my sample project. |
Hi there,
Can't use Hilt in dynamic modules yet?
merci merci |
Versions:
I tried Dagger Hilt with Dynamic Feature Modules.
Here is a sample project:
https://github.com/yamasa/Hilt_DFM
But, unfortunately, Dagger Hilt doesn't work for Activities in DFM.
It crashes with the following exception:
Does Dagger Hilt currently support Dynamic Feature Modules?
If not, is there a plan to support it?
The text was updated successfully, but these errors were encountered: