Skip to content
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

realworldappInjector: cant ad the modules into the component.builder due to error #75

Open
jonneymendoza opened this issue May 31, 2018 · 4 comments

Comments

@jonneymendoza
Copy link

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
@jonneymendoza
Copy link
Author

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

@fabioCollini
Copy link
Owner

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

@jonneymendoza
Copy link
Author

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

@fabioCollini
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants