I have added OkHttpProfilerInterceptor for intercepting HTTP requests. But since I upgraded my Target SDk to 30, it's crashing here.
if (HelperMethods.isDebug()) {
OkHttpClient client = new OkHttpClient().newBuilder().addInterceptor(new OkHttpProfilerInterceptor()).build();
AndroidNetworking.initialize(getApplicationContext(), client);
} else
AndroidNetworking.initialize(getApplicationContext());
Error Log
Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 30
at okhttp3.internal.platform.AndroidPlatform$Companion.buildIfSupported(AndroidPlatform.kt:370)
at okhttp3.internal.platform.Platform$Companion.findPlatform(Platform.kt:204)
at okhttp3.internal.platform.Platform$Companion.access$findPlatform(Platform.kt:178)
at okhttp3.internal.platform.Platform.<clinit>(Platform.kt:179)
at okhttp3.OkHttpClient.<init>(OkHttpClient.kt:211)
at okhttp3.OkHttpClient.<init>(OkHttpClient.kt:204)
I am not sure why this happening, because it was working fine when my target version was 29, since playstore doesn't allow sdk 29 now, I am stuck over here.
I tried updating the okhttp library version but it did not work.