Posted on

Dagger test, androidTest component generated code

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

Espresso Dagger

Dagger not generating components for /test class

if we use apt

// for androidTest
androidTestApt 'com.google.dagger:dagger-compiler:<version>'

// for unit test
testApt 'com.google.dagger:dagger-compiler:<version>'

if we use annotationProcessor

androidTestAnnotationProcessor 'com.google.dagger:dagger-compiler:<version>'
testAnnotationProcessor 'com.google.dagger:dagger-compiler:<version>'
Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.