Great article! Thanks!

I’m still having a problem though, and it is preventing me to migrate dagger graph to Kotlin in the app I’m developing. The problem arise when I need to inject in a dagger module method a @Named parameter, in this case I’m not injecting it through a constructor or a field, I’ve tried all Kotlin annotation use-sites targets and none of them seems to work in a method parameter. Please any solution will be very much appreciated. Next you can find the portion of java code having the problem:

@Module
public final class MyModule {
(...)@Provides
@Singleton
LoginStore provideLoginStore(@Named("main_dao_session") DaoSession mainDaoSession, @Named("demo_dao_session") DaoSession demoDaoSession) {
return new LoginStoreImpl(mainDaoSession, demoDaoSession);
}
(...)}

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade