DaggerMock
DaggerMock copied to clipboard
realworldappInjector: cant ad the modules into the component.builder due to error
Hi i am getting the following error following your example
error: @Component.Builder has setters for modules or components that aren't required:
this happens when i add the following line to my component like in your example realworldappInjector project
/*used for daggerMock for instrumentalTests */ fun accountModule(accountModule: AccountModule): Builder
fun mainModule(mainModule: MainModule): Builder
edit: if i dont add that to my component.builder, i get this error:
Error invoking setter with parameter class Module on object Component.
Any suggestions? trying to use daggermock with espresso and using 0.8.4
Hi, are you defining the MainModule in the module attribute of the @Component annotation?
Removing the definition in the example I get the same error
Hi that seem to work when i added MainModule to the @Cmponent annotation, however the mocks from my actual test class never gets injected using this rule and instead just uses the default injected values
Can you provide more info? Do you get any error? Which test are you writing, jvm or espresso? Are you using kotlin and are you using a library to open the classes?