简体   繁体   中英

Dagger 2.10 - ContributesAndroidInjector annotation

I've just implemented dagger.android as per documentation . First incorrect thing written there is existence of HasActivityInjector that was easily replaced with HasDispatchingActivityInjector .

Another thing mentioned there is usage of @ContributesAndroidInjector annotation that should simplify source creation a bit... But I cannot find such annotation neither via Android studio autocomplete nor in their JavaDoc and link in the documentation redirects me to 404 site. How can i use the annotation? Or can I?

Edit : I'm using

compile "com.google.dagger:dagger:$rootProject.daggerVersion"
compile "com.google.dagger:dagger-android:$rootProject.daggerVersion"
annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.daggerVersion"
annotationProcessor "com.google.dagger:dagger-android-processor:$rootProject.daggerVersion"

where daggerVersion = '2.10'

@ContributesAndroidInjector is in HEAD , added ten days ago . It is not yet in a numbered release in Maven, but I'd imagine it will be shortly. Until then, you can download or clone the repository directly from Github (click the green button).

Edit: @ContributesAndroidInjector was released in Maven under version 2.11-rc1. Also HasDispatchingActivityInjector interface is now called HasActivityInjector as per documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM