Square dagger bug: class is exclusively members that enter / cannot be scoped
I get the following dagger error when compiling a module:
test.MyClass is exclusively members injected and therefore cannot be scoped required by test.MyModule for test.MyModule
Google doesn't help in this case.
I have a fairly simple architecture: 1 module, all injected classes are listed in the adds clause. I don't see anything that might be causing the problem.
+3
user2368140
source
to share
1 answer
The error occurs due to a missing constructor @Inject
.
In my case, I used the lombok constructor generator in the class. IE.
@RequiredArgsConstructor(onConstructor = @__({@Inject}))
public class MyClass {
private final AnotherClass anotherClass;
}
And going to the explicit constructor solved the problem.
I expect the failure to be related to firing the dagger before generating the generated code. (Similarly to this question and related issue .)
0
source to share