I'm new to dagger and I'm studding it with small app for android. I'm trying to use Retrofit for REST request over http and https to two servers (dev and prod). So I have module in debug flavour where :
@dagger.Module(overrides = true, library = true, complete = false)
public class DebugApiModule {
private static final String SRV = "dev.mysrv.com";
private static final String HTTP = "http://";
private static final String HTTPS = "https://";
public static final String API_URL = HTTP + SRV;
public static final String API_URL_SECURE = HTTPS + SRV;
@Provides @Singleton @Api String provideApi() { return API_URL; }
@Provides @Singleton @ApiSecure String provideApiSecure() { return API_URL_SECURE; }
}
Here I'm using annotation in order to differ two strings but I get error:
Error:(23, 50) error: Duplicate bindings for java.lang.String in override module(s) - cannot override an override:
com.myapp.common.api.DebugApiModule.provideApi()
com.myapp.common.api.DebugApiModule.provideApiSecure()
what's wrong with this code ?