Where do you actually enter ClassWithoutInjects ?
injects in a module refers to classes that will query the dependencies provided by that module.
So, in this case, Dagger expects ClassWithoutInjects request ClassWithoutInjects dependencies, with the dependencies provided by this module (which is currently empty).
If you want to provide ClassWithoutInjects as a dependency, and not as a dependency consumer (which is what it is configured like in a module), either add @Inject to the constructor, or add an explicit provider method in the module.
@Module public class SimpleModule { @Provides ClassWithoutInjects provideClassWithoutInjects() { return new ClassWithoutInjects(); } }
If ClassWithoutInjects is a dependency consumer.
@Module(injects = ClassWithoutInjects.class) public class SimpleModule {
source share