Duplicate bindings created for multiple @MergeComponent
s of the same scope
#123
Labels
bug
Something isn't working
@MergeComponent
s of the same scope
#123
There must be two components in a classpath. It doesn't matter if they're in the same Gradle module, or the same package, or if one of those components is in test source.
My specific issue was for creating duplicate bindings for
TestAppComponent
when I'd already created them forAppComponent
in the same (Gradle) module.Example:
src/java/main/com/example/app/Component.kt
src/java/test/com/example/app/TestComponent.kt
Tangle just looked for the
@MergeComponent
annotation, and creates essentially the same code for both:And that
provideTangleFragmentFactory
function creates issues. There's a similar problem with the Subcomponent factory bindings created for ViewModels.If this was just vanilla Dagger, the fix would be to make the generated module
internal
, since it's in the same package as the component and only needs to be visible right there. However, Anvil doesn't supportinternal
modifiers.The text was updated successfully, but these errors were encountered: