Search code examples
androidkotlinannotationsdagger

What can I do if Dagger's annotation doesn't work?


Unfortunately, even though, that I added dependencies of Dagger. Dagger's annotation is not visible. I've tried invalidate caches and restart. Also, I've tried rebuilding of the project if I'm not mistaken. What can I do? Thank you guys in advance.

The error.

My build.gradle dependencies.

enter image description here


Solution

  • You should set version correctly for your dependencies. If you define the variable which will used in multiple dependency declarations, then you should wrap dependency in double quotes and pass your varible with symbol $, like this:

    implementation "com.google.dagger:dagger:$dagger_version"