Retrofit2:adapter-rxjava 证书问题 [英] Retrofit2:adapter-rxjava Certificate issue

查看:59
本文介绍了Retrofit2:adapter-rxjava 证书问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 android 项目中有以下依赖项:

I have the following dependencies in my android project:

implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.2.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.okhttp3:okhttp:3.7.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.7'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'

但是,com.squareup.retrofit2:adapter-rxjava2:2.4.0"依赖项会导致与改造库的问题或冲突.当我发出网络请求时,它会导致证书错误.但是,当我删除相同的依赖项时,一切似乎都正常.

However, the 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' dependency is causing issues or conflicts with the retrofit library. When I make network requests it results in a certificate error. However, when I remove the same dependency everything seems to work fine.

推荐答案

尝试使用 相同版本的 Retrofit 依赖项,例如目前最新版本是 2.5.0

Try to use same version of Retrofit dependencies, like for now latest version is 2.5.0

implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0'

这篇关于Retrofit2:adapter-rxjava 证书问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆