Expected Android API level 21+ b
2022-05-05 本文已影响0人
lirudong
OKhttp3版本过低导致在安卓高版本上闪退
Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 30
at okhttp3.internal.platform.AndroidPlatform.buildIfSupported(AndroidPlatform.java:238)
at okhttp3.internal.platform.Platform.findPlatform(Platform.java:202)
at okhttp3.internal.platform.Platform.<clinit>(Platform.java:79)
解决办法:升级最新的OKhttp3版本
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
implementation 'com.squareup.okio:okio:2.8.0'