java.lang.NoClassDefFoundError: java.util.Objects
See original GitHub issuethis 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)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:7 (2 by maintainers)
Top Results From Across the Web
java.lang.NoClassDefFoundError: java.util.Objects
The exception is thrown because all static methods of java.util.Objects are available above API 19 (Android 4.4.+). As you said in comments, ...
Read more >3 ways to solve java.lang.NoClassDefFoundError in Java J2EE
NoClassDefFoundError in Java comes when Java Virtual Machine is not able to find a particular class at runtime which was available at compile...
Read more >java.lang.NoClassDefFoundError - DigitalOcean
java.lang.NoClassDefFoundError is runtime error thrown when a required class is not found in the classpath and hence JVM is unable to load ...
Read more >NoClassDefFoundError (Java Platform SE 8 )
Thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a...
Read more >ClassNotFoundException Vs NoClassDefFoundError in Java
This exception is a checked Exception derived from java.lang.Exception class and you need to provide explicit handling for it.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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.
E/AndroidRuntime: FATAL EXCEPTION: main java.lang.NoClassDefFoundError: java.util.Objects at okhttp3.CertificatePinner.withCertificateChainCleaner(CertificatePinner.java:231) at okhttp3.OkHttpClient.<init>(OkHttpClient.java:238) at okhttp3.OkHttpClient.<init>(OkHttpClient.java:202)
@JakeWharton