Dagger 2 – two provides method that provide same interface

I recently post the answer to a question like this in this post : Dagger 2 : error while getting a multiple instances of same object with @Named You need to use @Named(“someName”)in your module like this: @Module public class ApplicationModule { private Shape rec; private Shape circle; public ApplicationModule() { rec = new Rectangle(); … Read more

Dagger2 : How to use @Provides and @Binds in same module

@Binds and @ContributesAndroidInjector methods must be abstract, because they don’t have method bodies. That means that they must go on an interface or abstract class. @Provides methods may be static, which means they can go on abstract classes and Java-8-compiled interfaces, but non-static (“instance”) @Provides methods don’t work on abstract classes. This is explicitly listed … Read more

Dagger and Kotlin. Dagger doesn’t generate component classes

You need to have the kapt processor in build.gradle: kapt { generateStubs = true } dependencies { … compile “org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version” compile ‘com.google.dagger:dagger:2.0.2’ kapt ‘com.google.dagger:dagger-compiler:2.0.2’ … } This extension will generate the code for dagger. Additionally, for newer gradle versions, you can also apply the plugin in your build.gradle: apply plugin: ‘kotlin-kapt’ dependencies { … compile … Read more

Dagger 2 multibindings with Kotlin

As it described in the Kotlin reference To make Kotlin APIs work in Java we generate Box<Super> as Box<? extends Super> for covariantly defined Box (or Foo<? super Bar> for contravariantly defined Foo) when it appears as a parameter. You can use @JvmSuppressWildcards for avoiding it, just as following: @Inject lateinit var foo: Set<@JvmSuppressWildcards Foo>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)