https://kotlinlang.org logo
#dagger
Title
# dagger
m

Mohamed Ibrahim

08/24/2020, 3:20 PM
how to use Hilt with Dagger/Android for example AndroidInjector side by side
g

gildor

08/24/2020, 5:07 PM
Configure hilt for your app and install your root module (which now includes all your modules including dagger android ones) to application scope, so after that they will work side by side, after all dagger-android uses standard dagger, just generate subcomponents when you use ContributeAndroidInjector
m

Mohamed Ibrahim

08/24/2020, 11:06 PM
is there any proper example for that, I have a base activity which is DaggerActivity has
AndroidInjector
don’t know how to make them work during Hilt migration
g

gildor

08/24/2020, 11:45 PM
Just follow official migration doc (esp first step, migrate application), enable hilt, connect all your all your existing modules to app component, dagger android will continue work https://dagger.dev/hilt/migration-guide
👍 1
6 Views