am getting `Component not initialized` when runnin...
# dagger
m
am getting
Component not initialized
when running tests
hey
I was able to fix it
inside your
andriodTest
create separate
Manifest.xml
file and define startup inside of it and disable automatic initialization
do it manually
j
I created
AndroidManifest
inside
androidTest
added
tools:node="remove"
to disable automatic initialization but still failed to create the hilt component for testing. In my case it's not merging at all with the
main
app manifest. So I ended up refactoring the startup, removing manifest initialization for the
main
app altogether and manually triggering the startup inside the Application class. Not ideal, but I didn't had any espresso UI testing issues before migrating Dagger to Hilt.
z
@Marko Novakovic @Jay Barria Thank you for your replies. Sorry, I noticed your replies only now, so I will work on it now, trying your recommendations, too.
Unfortunately androidTest manifest is not overriding the main manifest, so I had to do what Jay recommended. It seems to work, thank you all.
👍 1
e
Got same issues… so in short you avoid the manifest init
the only thing they just decided not to use their own library
148 Views