Hello everyone, can anyone help me with an issue with hilt and modularised apps?
So far my app has 3 modules: app (the default one), di and network. The idea here is putting hilt related dependencies in the DI module, so consumer modules can use this DI library without explicitly declaring the dependencies in the module's gradle file.
😶 2
Lucca Beurmann
12/09/2021, 12:04 AM
Currently this is my structure:
Network consumes DI module
App consumes both Network and DI
But for some reason the hilt module declared in the Network module throws an error saying that the dependencies needed to create the objects aren't defined
Lucca Beurmann
12/09/2021, 12:07 AM
In this image you can clearly see that SharedPreferences and NetworkClientRepository are declared in my module file
Lucca Beurmann
12/09/2021, 12:09 AM
But i keep receiving these two errors saying that those types aren't defined in a module with @Provides annotated method
Lucca Beurmann
12/09/2021, 12:53 AM
I found a solution, i forgot to add the hilt/kapt dependencies in the Network module
Lucca Beurmann
12/09/2021, 12:54 AM
But i'm still wondering why i have to declare the hilt dependencies in every module instead of declaring only in the DI module