Skip to content
Advertisement

Tag: dagger

Dagger Dependency Injection Provider with Qualifier

I’d like to get a confirmation that: if two providers providing the same type of instance, one with qualifier and the other one without, would this work? For the following two cases, especially the TestClass1, will Dagger know which MetricsCollectorFactory to inject? Answer Yes, as on the Dagger dev guide, there are zero or one qualifier instances per key or

@Generated annotation using gradlew + dagger

I’m confronting a weird issue using gradlew(4.10.2) + dagger(2.18). The problem is when I call: The build fails with: Task :Common:compileDebugJavaWithJavac FAILED /CommonModule_ProvidesGsonFactory.java:6: error: package javax.annotation.processing does not exist import javax.annotation.processing.Generated; /CommonModule_ProvidesGsonFactory.java:8: error: cannot find symbol @Generated( But if I run the task from Android Studio, the task succeed and the @Generated is not present in the dagger generated class.

Advertisement