I am trying to use the @ContributesAndroidInjector
to provide a class in my dagger module and I'm seeing the error: [ClassName] is not a framework type.
Does anyone know what a "framework type" is and in which cases would a class not be one?
If Dagger2 can not generate its components it means that your code have some errors with Scopes/Modules. Check our your @Provides/Inject methods. You should inject your components into cases where you need instances of classes provided by module. Show activity on this post.
I had a project with Dagger injecting something into Presenters At one moment I got a persistent "NonExistentClass.java:3: error: error.NonExistentClass must be INTERFACE" error The root cause was trivial: a rogue copy of the valid @Inject annotated file with unsatisfied dependencies somehow slipped into the project.
The generated class will be named DaggerComponentClass, not DaggerCompClassComponent. If you can't run your app in Android Studio to get it built, try Build->Clean project and Build->Rebuild project in the menu.
Because Kotlin makes its stubs before Java Annotation Processing runs, Kotlin knows just nothing about OrmaDatabase, and the name of the declaration in stubs will be error.NonExistentClass. This breaks the Annotation Processing tool. It's a kind of kapt limitation Just use plain apt or annotationProcessor for running Dagger compiler.
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 love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With