Dagger-android application build failed
See original GitHub issueI made a sample application and did all steps from the manual. But something is not working.
Error:(11, 8) error: [dagger.android.AndroidInjector.inject(T)] java.util.Map<java.lang.Class<? extends android.support.v4.app.Fragment>,javax.inject.Provider<dagger.android.AndroidInjector.Factory<? extends android.support.v4.app.Fragment>>> cannot be provided without an @Provides-annotated method.
java.util.Map<java.lang.Class<? extends android.support.v4.app.Fragment>,javax.inject.Provider<dagger.android.AndroidInjector.Factory<? extends android.support.v4.app.Fragment>>> is injected at
dagger.android.DispatchingAndroidInjector.<init>(injectorFactories)
dagger.android.DispatchingAndroidInjector<android.support.v4.app.Fragment> is injected at
dagger.android.support.DaggerApplication.supportFragmentInjector
com.*.*.presentation.component.Application is injected at
dagger.android.AndroidInjector.inject(arg0)
My activity inherits DaggerAppCompatActivity, and my application is here:
public class Application
extends DaggerApplication {
@Inject
DispatchingAndroidInjector<Application> injector;
@Override
public void onCreate() {
super.onCreate();
DaggerApplicationComponent.create()
.inject(this);
}
@Override
protected AndroidInjector<? extends DaggerApplication> applicationInjector() {
return injector;
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:10
Top Results From Across the Web
Dagger build error - java - Stack Overflow
with newest android studio (3.1.1) and gradle (3.1.1) on mac osx. Of course I've tried invalidating cache and restarts, cleans etc. I've ...
Read more >Build errors: kapt3 dagger graph failure - Issue Tracker
With the recent canary, kapt fails to build my project. I'll attach it. ... e: C:\Users\daykm\StudioProjects\P5Executioner\app\build\tmp\kapt3\stubs\appDebug\com\ ...
Read more >Using Dagger in Android apps
To use Dagger in your project, add these dependencies to your application in your build.gradle file. You can find the latest version of...
Read more >"Build failed" error pointing to DI:dagger while building-kotlin
[Solved]-Android: "Build failed" error pointing to DI:dagger while building-kotlin · Related Query · More Query from same tag · Contact Us · Quick...
Read more >Issues faced when setup Dagger 2 on Kotlin | by Elye - Medium
Upon first compilation, you'll see this error keep occuring. Don't know why it happens. Apparently, you just need to delete and clean your...
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
You need to include AndroidSupportInjectionModule. That protects you in case you ever add a support fragment in the future.
On Wed, Jun 21, 2017, 8:29 AM Artem Shalaev notifications@github.com wrote:
I don’t think this ticket should be closed. The additional module is not documented. It seems like it should not be required either. Maybe the docs should be updated here or the requirement should be removed.
I ran into this problem some time after getting the basic sample with empty modules working. It happened while trying to provide additional dependencies from my Activity module. So the AndroidSupportInjectionModule is not required, then it is required later at a seemingly arbitrary point.