I'm trying to make multi module project with Dagger2
. You can see my code following the link. In the main
branch is working solution where all the dagger classes are in presentation
module.
Now I'm trying to make separate app
module for the DI root. You can see the latest attempts in the develop
branch. It's not working. I want to make my root ApplicationComponent
component in app
module and add there PresentationComponent
(sub)component from other module. Every time I try something, eventually I get following:
dagger.internal.codegen.ComponentProcessor was unable to process 'ru.ircover.schultetables.app.ApplicationComponent' because not all of its dependencies could be resolved. Check for compilation errors or a circular dependency with generated code
It's very strange as I didn't change any dependencies in comparison with main
branch. The only thing changed - new link from root component ApplicationComponent
to child PresentationComponent
. As I understand it, there is no way to appear circular dependency as app
module and its content is not visible in presentation
module. I've followed all the tutorials I've met in google, but none of them helped.
What I've already tried:
Builder
or Factory
of subcomponent.subcomponent
link.inject
methods of child component to the parent.Now I'm stuck. It seems that the problem is somewhere in components or modules connection, but I can't manage to find where and how it happened. I need help here.
I've managed to build your project with these changes: