@ContributesAndroidInjector broken - nondescript error
See original GitHub issueTried to use @ContributesAndroidInjector
in a simplistic sample project but failed and no idea what the problem is. The sole build error is
dagger.internal.codegen.ComponentProcessor was unable to process this interface because not all of its dependencies could be resolved. Check for compilation errors or a circular dependency with generated code.
interface AppComponent extends AndroidInjector<MainApplication> {
^
1 error
I followed the documentation in creating my sample code. I have no errors when I replace the @ContributesAndroidInjector
with the equivalent old-style code.
Same issue with UsesGeneratedModulesApplication
from the Dagger repository, at least when I build it in a Gradle project.
Issue Analytics
- State:
- Created 6 years ago
- Comments:26
Top Results From Across the Web
Error: @dagger.android.ContributesAndroidInjector was used ...
Go to your module level build.gradle , under. annotationProcessor 'com.google.dagger:dagger-android-processor:[YOUR VERSION NUMBER]' ,. add:.
Read more >[Help] Generic, Dagger 2 Injected ViewModel : r/androiddev
But with Jetpack Navigation, it'd break unless the ViewModel is injected into a Fragment inside ... I keep getting nondescript build errors.
Read more >Dagger 2 with ContributesAndroidInjector - Is it easy? - Medium
If we do not include this module in our root component compiler will generate an error stating can not be injected without @Provides...
Read more >Dagger 2 Annotations: @Binds & @ContributesAndroidInjector
This article is a part of the “Dagger and the Dahaka” series. In this article we will briefly look at two annotations :...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
“Just incase anyone as dumb as me also comes across this thread”
Another dumbass in the party. You’re my life savior! I’m struggling since several hours! Who could expect that
@ContributesAndroidInjector
requires a separate artifact! If anyone in future sees the error messagecomponentProcessor was unable to process this interface because not all of its dependencies could be resolved. Check for compilation errors or a circular dependency with generated code.
the above could be the cause.Guys, I’m using kotlin in android studio. What was causing this error was because i was using
annotationProcessor
instead ofkapt
Can you see the last line of code above? yah that one made me struggle for like 2 days. so,as i said, what was needed is kotlin application processing tool. a.k.a
kapt
and notannotationProcessor