Android OkHttp實現HTTPS訪問,支持Android 4.X系統HTTPS訪問
看到這個錯誤信息Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 19,應該是版本的問題,去okhttp查了一下原來是自己沒仔細看介紹
okhttp的fix分支3.12.x版本,而我項目裏面用的是
implementation(“com.squareup.okhttp3:okhttp:3.14.1”)
修改爲 implementation(“com.squareup.okhttp3:okhttp:3.12.0”)即可解決,特此記錄一下,看來集成三方開源庫時還是要時不時的看看人家的介紹。
歡迎愛學習的小夥伴加羣一起進步:230274309 。 一起分享,一起進步!少划水,多曬乾貨!!歡迎大家!!!(進羣潛水者勿加) |