使用OKHttp3作为网络访问的框架时,可能要经常查看日志,这时我们可以引入logging-interceptor拦截器。如下:
compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'
但是,如果出现如题目中的错误,那原因应该就是logging-interceptor的版本和OkHttp3的版本不一样,保持一样就可以了。
compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'
compile 'com.squareup.okhttp3:okhttp:3.8.1'