Dagger 2 generated test component not recognized

后端 未结 3 1573
眼角桃花
眼角桃花 2020-12-09 19:37

I\'m hoping that this is just something I\'m doing wrong here. I\'m trying to use Dagger 2.0 to inject dependencies for my JUnit tests (not Espresso tests, just pu

3条回答
  •  时光说笑
    2020-12-09 20:16

    Depending on your test type:

    • insert testAnnotationProcessor "com.google.dagger:dagger-compiler:2.x" inside dependencies on your build.gradle file for src/test

    or

    • insert androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:2.x" inside dependencies on your build.gradle file for src/androidTest

提交回复
热议问题