to allow Dagger to generate code in test and androidTest folders we should add dependencies test
and androidTest
to gradle.
Dagger test component not found
Dagger not generating components for /test class
if we use apt
[code]
// for androidTest
androidTestApt ‘com.google.dagger:dagger-compiler:<version>’
// for unit test
testApt ‘com.google.dagger:dagger-compiler:<version>’
[/code]
if we use annotationProcessor
[code]
androidTestAnnotationProcessor ‘com.google.dagger:dagger-compiler:<version>’
testAnnotationProcessor ‘com.google.dagger:dagger-compiler:<version>’
[/code]