Skip to content Skip to sidebar Skip to footer

Dagger 2 - Why Is This A Dependency Cycle?

I'm trying to inject the application's Context into 2 other objects, an AuthManager and an ApiClient. Both of them depends on said context, and the ApiClient depends on the AuthMa

Solution 1:

@Provides@Singleton
public AuthManager providesAuthManager(AuthManager manager) {
    returnmanager;
}

Your providesAuthManager method which provides an AuthManager depends on an AuthManager.

There's your cycle :)

Solution 2:

Post a Comment for "Dagger 2 - Why Is This A Dependency Cycle?"