Skip to content Skip to sidebar Skip to footer

Dagger Androidinjector Cannot Be Provided Without An @provides-annotated Method

I've done my Android projects MainActivity by means of the MVP pattern. So in my MainPresenter I want to inject a dynamic String, which then shall populate a TextView for instance:

Solution 1:

You're providing a DynamicString while expecting a regular String in the constructor. You should use DynamicString there as well:

classMyMainPresenter @Injectconstructor(
    @StringForTextViewdynamicString: DynamicString
)

Also, you might want to hols on to that injected value by making it a property with val.

Post a Comment for "Dagger Androidinjector Cannot Be Provided Without An @provides-annotated Method"