Dagger2 - "is not a framework type." error
In my case the error occurred when using dagger 2.20.
The issue drove me crazy so I took a clean example and everything was working correctly until I upgraded the version to 2.20. Then I got the "is not a framework type" error.
I changed the version to 2.19 and everything was working again.
If you have a look at the documentation it says that
This annotation must be applied to an abstract method in a Module that returns a concrete Android framework type (e.g. FooActivity, BarFragment, MyService, etc).
You can use it with fragments, activities, services, or applications. You can not use it to create arbitrary modules with arbitrary objects. You should use constructor injection where possible, and @Provides
annotated methods where not.
Field injection is reserved for (Android) framework types and should not be used if you can provide your objects in the 2 ways mentioned above.
I would suggest that you have another look at the Dagger 2 documentation or some tutorials for further information on how you can provide objects. You can also find a blog post of myself about the Dagger Basics.