0

I try to update my dagger version from 2.0.2 to 2.9

...
compile 'com.google.dagger:dagger:2.9'
apt 'com.google.dagger:dagger-compiler:2.9'
...

Now my project not builds. I have lot of "error: cannot find symbol MyClass_" and "warning: unknown enum constant Scope.LIBRARY_GROUP" 100 errors 90 warnings

I did not change anything in the file build.gradle except two dagger rows. I use: AS 2.3, gradle 3.3, JDK 1.8, buildToolsVersion 25.0.0

Thanks

Viktor Burmaka
  • 211
  • 4
  • 8
  • I'm glad you found an answer to your question! Thank you for linking your source and sharing your answer with the world. Just to keep the separation clear between question and answer, please consider deleting the update out of your question and add it as a [self-answer](https://stackoverflow.com/help/self-answer) instead. That way others can know this question has been answered, and easily read the answer where they're used to seeing it. – Jeff Bowman Apr 04 '17 at 21:11
  • @Jeff Bowman Thanks, did as you said – Viktor Burmaka Apr 06 '17 at 14:29

1 Answers1

1

Finally I found what I was looking for many months!

Dagger 2 on Android, no error messages

Now I can see the reason of my error. I had tree errors :

  1. error: @Scope annotations are not allowed on @Inject constructors. Annotate the class instead.
  2. error: it.clipcall.infrastructure.RandomNumberGenerator cannot be provided without an @Inject constructor or from an @Provides-annotated method.
  3. error: dagger.internal.codegen.ComponentProcessor was unable to process this class because not all of its dependencies could be resolved. Check for compilation errors or a circular dependency with generated code.

I just fix first and project is successfully built with one warning "unknown enum constant Scope.LIBRARY_GROUP"

Community
  • 1
  • 1
Viktor Burmaka
  • 211
  • 4
  • 8