Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting java.lang.NoSuchMethodError, No virtual method log(ILjava/lang/String;Ljava/lang/Throwable;)

I have add Itercom Chat for Customer support or Contact Us. But When I add Intercom sdk dependency
(implementation 'io.intercom.android:intercom-sdk-base:9.+') and App run then crash my App. i get error like below

java.lang.NoSuchMethodError: No virtual method log(ILjava/lang/String;Ljava/lang/Throwable; V in class Lokhttp3/internal/platform/Platform;

or its super classes (declaration of 'okhttp3.internal.platform.Platform' appears in /data/app/com.exampla.app-Opatc6X6ZSZqGt8Wv1Uwty==/base.apk!classes3.dex)

like image 528
Arti Avatar asked Dec 29 '25 01:12

Arti


1 Answers

You have to use the same version of the okHttp library. in my case it was

implementation 'com.squareup.okhttp3:okhttp:4.9.2'
implementation 'com.squareup.okhttp3:logging-interceptor:3.6.0'

Which was throwing this exception which is

java.lang.NoSuchMethodError: No virtual method log(ILjava/lang/String;Ljava/lang/Throwable; V in class Lokhttp3/internal/platform/Platform;

So fix will be in your build.gradle file you have to use same versions:

implementation 'com.squareup.okhttp3:okhttp:4.9.2'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.2'

It will fix your issue. This is too late to share an answer but might help others also.

like image 91
Anant Shah Avatar answered Dec 30 '25 17:12

Anant Shah



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!