问题
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'
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.
回答1:
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'
来源:https://stackoverflow.com/questions/54905331/retrofit2adapter-rxjava-certificate-issue