i'm getting issues with running my app in a device (android 4.3) and i'm getting this error : E/AndroidRuntime: FATAL EXCEPTION: main java.lang.NoClassDefFoundError: java.util.Objects
I know that The exception is thrown because all static methods of java.util.Objects are available above API 19 (Android 4.4.+) so that method doesn't exist in that Android version and NoClassDefFoundError is thrown.
But i also need my app to be compatible with version 4.3, how can i fix it ?
trace : java.lang.NoClassDefFoundError: java.util.Objects at okhttp3.CertificatePinner.withCertificateChainCleaner(CertificatePinner.java:231) at okhttp3.OkHttpClient.(OkHttpClient.java:238) at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1015)
You are probably using OkHttp 3.13.x or higher 3.13.0 is the first release of OkHttp that bumps minimum requirements to Android 5+ API 21
Please try the 3.12.3 version as it should support devices with Android 2.3+ (API 9+)
Source: https://square.github.io/okhttp/changelog_3x/#version-3130
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With