How to fix Expected Android API level 21+ but was 19 in Android

后端 未结 11 1764
甜味超标
甜味超标 2020-12-10 01:06

In my application i want get data from server, for get connect to server i used Retrofit, OkHttp.
But when running application, show me

11条回答
  •  暖寄归人
    2020-12-10 01:44

    For minSDK lower than 21, change your OkHttp version to 3.12.12 in gradle like this -

      //OkHttp
      implementation ("com.squareup.okhttp3:okhttp:3.12.12"){
          force = true //API 19 support
      }
      implementation 'com.squareup.okhttp3:logging-interceptor:3.12.12'
    

    It should work fine!

提交回复
热议问题