I am using Dagger-2 (ver: 2.7) and AutoFactory (ver: 1.0-beta3). I am facing a peculiar issue.
I have a a class MyRequest who's ctor takes 2 parameters as:
- ConnectivityManager conmgr
- int somevalue
I created the ctor as
@Autofactory
public MyRequest(@Provider ConnectivityManager conmgr, int somevalue){
//
}
I have a module containing the following
@Provides
@SystemScope
public final ConnectivityManager provideConnectivityManager(App app) {
return (ConnectivityManager)
app.getSystemService(Context.CONNECTIVITY_SERVICE);
}
In the same module I do the following
@Provides
@SystemScope
public final MyRequestFactory providesMyRequestFactory(ConnectivityManager connectivityManager {
return new MyRequestFactory(connectivityManager);
}
I am getting build error incompatible types: ConnectivityManager cannot be converted to Provider < ConnectivityManager >.
Any idea how to solve this ?