Android Dagger2 + OkHttp + Retrofit dependency cycle error

后端 未结 4 1538
不知归路
不知归路 2020-12-08 11:15

Hey there I am using Dagger2, Retrofit and OkHttp and I am facing dependency cycle issue.

When providing OkHttp :

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-08 12:04

    You can inject the service dependency into your authenticator via the Lazy type. This way you will avoid the cyclic dependency on instantiation.

    Check this link on how Lazy works.

提交回复
热议问题