Open ContributesAndroidInjector for other classes
See original GitHub issueI’m using Conductor and created a DispatchingAndroidInjector
for Controllers
(like fragments from a dagger perspective).
That works great.
However I want to make use of the ContributesAndroidInjector
annotation because I don’t want to go through all the boilerplate of creating subscomponents manually. However dagger fails with an exception that only framework classes are allowed.
What is the reason for that? Can it be done anyways?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:12
- Comments:16 (1 by maintainers)
Top Results From Across the Web
Dagger 2 with ContributesAndroidInjector - Is it easy? - Medium
From docs — Android Injector is an interface that enclose an abstract class Builder<T> and a Factory interface, the main purpose of this ......
Read more >ContributesAndroidInjector same fragment with different ...
I've been trying to find a way to provide dependencies depending where a fragment is navigated from. I have the following in a...
Read more >Dagger 2 Annotations: @Binds & @ContributesAndroidInjector
In this article we will briefly look at two annotations : @Binds and @ContributesAndroidInjector . It is not mandatory to have read the ......
Read more >Injecting Activities with Dagger2 and ... - YouTube
In this video I show you how to use the @ ContributesAndroidInjector to "mark" an activity as a potential client for dagger dependency ......
Read more >Dagger by Tutorials, Chapter 16: Dagger & Android | Kodeco ...
Which utility classes Android Dagger provides. How to use @ContributesAndroidInjector . Why Android is different for Dagger. In the previous chapters ...
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 Free
Top 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
I’m reopening this - given the recent androidx developments and lots of new, smaller libraries, I think it’s worth reconsidering opening up support.
@AndroidInjectionKey
also simplifies this. And if people want to use class literals, they can use their own map key as well.Controllers are really similar to fragments and it’s a real bummer creating so many subcomponents.
Isn’t it possible to create some plugin structure where you can define your map
@MapKey
and base class?