title: Expected Android API level 21+ but was 19 while using Retrofit 2, OkHttp3
body: <p>I'm using <strong>Retrofit 2 and OkHttp3</strong> to data from server and I get 
  error while using <strong>Min_SDK 17</strong> and my device's API is <strong>17</strong> also</p>
  
  <p>I tried this answer :<a href="https://stackoverflow.com/questions/56818660/how-to-fix-expected-android-api-level-21-but-was-19-in-android">How to fix Expected Android API level 21+ but was 19 in Android</a></p>
  
  <p>Also I tried this answer <a href="https://github.com/square/okhttp/issues/4597#issuecomment-461204144" rel="nofollow noreferrer">https://github.com/square/okhttp/issues/4597#issuecomment-461204144</a></p>
  
  <p>but I get the same error . </p>
  
  <p><strong>my Gradle.Build class</strong></p>
  
  <pre><code>    apply plugin: 'com.android.application'
  
       android {
  compileSdkVersion 28
  defaultConfig {
      applicationId "some"
      minSdkVersion 17
      targetSdkVersion 28
      versionCode 1
      versionName "1.0"
      testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  }
  buildTypes {
      release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
      }
  }
  packagingOptions {
      exclude 'META-INF/DEPENDENCIES'
  }
  compileOptions {
      targetCompatibility = "8"
      sourceCompatibility = "8"
  }
  lintOptions {
      checkReleaseBuilds false
      // Or, if you prefer, you can continue to check for errors in release builds,
      // but continue the build even when errors are found:
  }
   }
  
   dependencies {
  implementation fileTree(dir: 'libs', include: ['*.jar'])
  implementation 'com.android.support:appcompat-v7:28.0.0'
  implementation 'com.android.support:support-v13:28.0.0'
  implementation 'com.android.support:design:28.0.0'
  implementation 'com.android.support.constraint:constraint-layout:1.1.3'
  implementation 'com.android.support:recyclerview-v7:28.0.0'
  implementation 'com.squareup.retrofit2:retrofit:2.4.0'
  implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
  implementation "com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0"
  implementation "com.squareup.okhttp3:okhttp:3.11.0"
  implementation "com.squareup.okhttp3:okhttp-urlconnection:3.11.0"
  implementation "com.squareup.okhttp3:logging-interceptor:3.11.0"
  implementation 'com.google.code.gson:gson:2.8.2'
  implementation 'net.alhazmy13.hijridatepicker:library:2.0.2'
  implementation group: 'com.github.msarhan', name: 'ummalqura-calendar', version: '1.1.9'
  implementation 'com.google.android.gms:play-services-maps:16.1.0'
  implementation 'com.google.android.gms:play-services-location:16.0.0'
  implementation 'com.google.android.gms:play-services-places:16.1.0'
  implementation 'com.github.jaiselrahman:FilePicker:1.0.2'
  implementation 'com.github.bumptech.glide:glide:4.5.0'
  implementation 'com.squareup.okhttp3:okhttp:3.13.1'
  implementation 'com.google.code.gson:gson:2.8.5'
  implementation 'com.loopj.android:android-async-http:1.4.9'
  implementation 'com.google.android.gms:play-services-auth-api-phone:16.0.0'
  
          annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
  
  testImplementation 'junit:junit:4.12'
  androidTestImplementation 'com.android.support.test:runner:1.0.2'
  androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
     }
  </code></pre>
  
  <p><strong>my API Client</strong></p>
  
  <pre><code>    public class APIClient {
  
  private static Retrofit retrofit;
  private static OkHttpClient okHttpClient;
  
  public static Retrofit getInstanceRetrofit(){
  
      if(okHttpClient==null) {
          initOkHttp();
      }
      if(retrofit==null) {
          retrofit = new Retrofit.Builder()
                  .baseUrl(Const.URL)
                  .client(okHttpClient)
                  .addConverterFactory(GsonConverterFactory.create())
                  .build();
      }
          return retrofit;
  
  }
  
    private static void initOkHttp() {
      int REQUEST_TIMEOUT = 60;
      OkHttpClient.Builder httpClient = new OkHttpClient().newBuilder()
              .connectTimeout(REQUEST_TIMEOUT, TimeUnit.SECONDS)
              .readTimeout(REQUEST_TIMEOUT, TimeUnit.SECONDS)
              .writeTimeout(REQUEST_TIMEOUT, TimeUnit.SECONDS);
  
      HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
      interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
  
      httpClient.addInterceptor(interceptor);
  
      httpClient.addInterceptor(new Interceptor() {
          @Override
          public Response intercept(@NonNull Chain chain) throws IOException {
              Request original = chain.request();
              Request.Builder requestBuilder = original.newBuilder()
                      .addHeader("Accept", "application/json")
                      .addHeader("Content-Type", "application/json");
              Request request = requestBuilder.build();
              return chain.proceed(request);
          }
      });
  
      okHttpClient = httpClient.build();
  }
    }
  </code></pre>
  
  <p><strong>my Logs</strong></p>
  
  <pre><code>    1-03 06:09:07.850 2827-2827/some
     E/AndroidRuntime: FATAL EXCEPTION: main
  Process: some, PID: 2827
  java.lang.ExceptionInInitializerError
      at okhttp3.OkHttpClient.newSslSocketFactory(OkHttpClient.java:296)
      at okhttp3.OkHttpClient.&lt;init&gt;(OkHttpClient.java:262)
      at okhttp3.OkHttpClient.&lt;init&gt;(OkHttpClient.java:235)
      at some.Network.APIClient.initOkHttp(APIClient.java:40)
      at some.Network.APIClient.getInstanceRetrofit(APIClient.java:25)
      at some.MvpImplementation.DropdownImpInteractor.getDropdowns(DropdownImpInteractor.java:18)
      at some.MvpImplementation.DropdownImpPresenter.requestDropdowns(DropdownImpPresenter.java:21)
      at some.Views.LoginActivity.onCreate(LoginActivity.java:87)
      at android.app.Activity.performCreate(Activity.java:5231)
      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
      at android.app.ActivityThread.access$800(ActivityThread.java:135)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:136)
      at android.app.ActivityThread.main(ActivityThread.java:5001)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:515)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
      at dalvik.system.NativeStart.main(Native Method)
   Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 19
      at okhttp3.internal.platform.AndroidPlatform.buildIfSupported(AndroidPlatform.java:238)
      at okhttp3.internal.platform.Platform.findPlatform(Platform.java:202)
      at okhttp3.internal.platform.Platform.&lt;clinit&gt;(Platform.java:79)
      at okhttp3.OkHttpClient.newSslSocketFactory(OkHttpClient.java:296) 
      at okhttp3.OkHttpClient.&lt;init&gt;(OkHttpClient.java:262) 
      at okhttp3.OkHttpClient.&lt;init&gt;(OkHttpClient.java:235) 
      at some.Network.APIClient.initOkHttp(APIClient.java:40) 
      at some.Network.APIClient.getInstanceRetrofit(APIClient.java:25) 
      at some.MvpImplementation.DropdownImpInteractor.getDropdowns(DropdownImpInteractor.java:18) 
      at some.MvpImplementation.DropdownImpPresenter.requestDropdowns(DropdownImpPresenter.java:21) 
      at some.Views.LoginActivity.onCreate(LoginActivity.java:87) 
      at android.app.Activity.performCreate(Activity.java:5231) 
      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148) 
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) 
      at android.app.ActivityThread.access$800(ActivityThread.java:135) 
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
      at android.os.Handler.dispatchMessage(Handler.java:102) 
      at android.os.Looper.loop(Looper.java:136) 
      at android.app.ActivityThread.main(ActivityThread.java:5001) 
      at java.lang.reflect.Method.invokeNative(Native Method) 
      at java.lang.reflect.Method.invoke(Method.java:515) 
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 
      at dalvik.system.NativeStart.main(Native Method)
  </code></pre>