this error throw when using retrofit version 2.5.0 in android lower than api 19
java.lang.NoClassDefFoundError: java.util.Objects
at okhttp3.CertificatePinner.withCertificateChainCleaner(CertificatePinner.java:231)
at okhttp3.OkHttpClient.<init>(OkHttpClient.java:271)
at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1054)
This is a problem with OkHttp, not Retrofit. Note OkHttp 3.13+ requires API 21+ but if you're using 3.12 or earlier please file a bug.
ok, when retrofit depend on okhttp how to fix it for api level lower than 19?
@JakeWharton
Retrofit doesn't require nor depend on 3.13 so it isn't forcing minSdk 21
On Mon, Mar 4, 2019 at 2:45 AM Milad Heydari notifications@github.com
wrote:
ok, when retrofit depend on okhttp how to fix it for api level lower than
19?—
You are receiving this because you modified the open/close state.Reply to this email directly, view it on GitHub
https://github.com/square/retrofit/issues/3042#issuecomment-469150305,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEEESPP2TNoaM7RFrGkzBWAFciL1e45ks5vTM8OgaJpZM4bbB_s
.
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: java.util.Objects
at okhttp3.CertificatePinner.withCertificateChainCleaner(CertificatePinner.java:231)
at okhttp3.OkHttpClient.
at okhttp3.OkHttpClient.
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: java.util.Objects
at okhttp3.CertificatePinner.withCertificateChainCleaner(CertificatePinner.java:231)
at okhttp3.OkHttpClient.
at okhttp3.OkHttpClient.
@JakeWharton
ok, when retrofit depend on okhttp how to fix it for api level lower than 19?
@JakeWharton
is your problem solved?
i have the same problem just in release apk and my okhhtp version is lower than 3.12.
Most helpful comment
This is a problem with OkHttp, not Retrofit. Note OkHttp 3.13+ requires API 21+ but if you're using 3.12 or earlier please file a bug.