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
Add this to build.gradle after android DSL:
android {
...
}
android.applicationVariants.all {
def aptOutputDir = new File(buildDir, "generated/source/apt/${it.unitTestVariant.dirName}")
it.unitTestVariant.addJavaSourceFoldersToModel(aptOutputDir)
}
Thereafter, your test component would be recognized.
For Kotlin replace generated/source/apt/... with generated/source/kapt/...
There is an issue raised in the tracker concerning this.