question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] Crash caused by NoSuchMethodError if OkHttp is added as dependency

See original GitHub issue

Description:

Adding com.squareup.okhttp3 to an android app with JitsiMeet causes a crash. The crash previously didn’t happen and has only started recently.

The app I’m working on uses these versions:

com.squareup.okhttp3:logging-interceptor:4.8.0
org.jitsi.react:jitsi-meet-sdk:2.9.0

The crash still occurs on the latest versions:

org.jitsi.react:jitsi-meet-sdk:2.10.0
com.squareup.okhttp3:logging-interceptor:4.9.0

Steps to reproduce:

  1. Add implementation "com.squareup.okhttp3:okhttp:4.9.0" to the Kotlin sample app.
  2. Run the app and try to join a room.

Actual behavior:

Crash from the sample app. org.jitsi.react:jitsi-meet-sdk:2.10.0 and com.squareup.okhttp3:logging-interceptor:4.9.0

2020-10-16 16:29:47.608 8687-9737/net.jitsi.sdktest E/JitsiMeetSDK: JitsiMeetUncaughtExceptionHandler FATAL ERROR
    java.lang.NoSuchMethodError: No static method delimiterOffset(Ljava/lang/String;IILjava/lang/String;)I in class Lokhttp3/internal/Util; or its super classes (declaration of 'okhttp3.internal.Util' appears in /data/app/net.jitsi.sdktest-jgIWMkCbwMhfqJgMlgFZOA==/base.apk!classes3.dex)
        at okhttp3.JavaNetCookieJar.decodeHeaderAsJavaNetCookies(JavaNetCookieJar.java:91)
        at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.java:74)
        at com.facebook.react.modules.network.ReactCookieJarContainer.loadForRequest(ReactCookieJarContainer.java:43)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:74)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)

Crash from a different app. com.squareup.okhttp3:logging-interceptor:4.8.0 and org.jitsi.react:jitsi-meet-sdk:2.9.0

2020-10-16 16:05:49.335 2835-5110/com.app.app E/JitsiMeetSDK: JitsiMeetUncaughtExceptionHandler FATAL ERROR
    java.lang.NoSuchMethodError: No virtual method toString(Z)Ljava/lang/String; in class Lokhttp3/Cookie; or its super classes (declaration of 'okhttp3.Cookie' appears in /data/app/com.app.app-yNgiyFZysSjxgqHj2FecXQ==/base.apk!classes3.dex)
        at okhttp3.JavaNetCookieJar.saveFromResponse(JavaNetCookieJar.java:45)
        at com.facebook.react.modules.network.ReactCookieJarContainer.saveFromResponse(ReactCookieJarContainer.java:36)
        at okhttp3.internal.http.HttpHeaders.receiveHeaders(HttpHeaders.kt:207)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:85)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)

Additional information

Here are some of the logs from JitsiMeetSDK from before the crash.

[features/base/media] Start audio only set to false
ExternalAPI Sending event: CONFERENCE_WILL_JOIN with data: { NativeMap: {"url":"https://meet.jit.si/gbe45y3f2465hni"} }
Conference will join: {url=https://meet.jit.si/gbe45y3f2465hni}
[modules/xmpp/xmpp.js] P2P STUN servers:  [ { urls: 'stun:stun.l.google.com:19302' },
      { urls: 'stun:stun1.l.google.com:19302' },
      { urls: 'stun:stun2.l.google.com:19302' } ]
[modules/xmpp/xmpp.js] (TIME) Strophe connecting:	 1602855924186
[features/analytics] Loaded 0 analytics handlers
[modules/RTC/RTCUtils.js] Get media constraints { audio: true, video: false }
[modules/RTC/RTCUtils.js] Get media constraints { audio: false,
      video: 
       { mandatory: { minWidth: 1280, minHeight: 720, maxWidth: 1280, maxHeight: 720 },
         optional: [ [Object] ],
         facingMode: 'user',
         width: { ideal: 1280 },
         height: { ideal: 720 } } }
[modules/statistics/AnalyticsAdapter.js] Disposing of analytics adapter.
[features/calendar-sync] Calendar access not granted.
[modules/RTC/RTCUtils.js] Available devices:  [ { kind: 'videoinput',
        label: '0',
        groupId: '',
        deviceId: '0',
        facing: 'environment' },
      { kind: 'videoinput',
        label: '1',
        groupId: '',
        deviceId: '1',
        facing: 'front' },
      { kind: 'audioinput',
        label: 'Audio',
        groupId: '',
        deviceId: 'audio-1' } ]
[modules/RTC/RTCUtils.js] onUserMediaSuccess
[modules/RTC/JitsiLocalTrack.js] Setting new MSID: e32f5cde-b37a-44ce-9a22-ac2487dd8f88 a81d7096-6b22-436e-b2b1-9d6f954223d4 on LocalTrack[undefined,audio]
[modules/RTC/RTCUtils.js] onUserMediaSuccess
[modules/RTC/JitsiLocalTrack.js] Setting new MSID: d77923a6-26d7-45b2-a4be-c07376c7916f 7938eda4-0ca3-4969-adaa-71be4f771285 on LocalTrack[undefined,video]
2020-10-16 16:45:24.541 1758-13591/? E/ScreenModeService: getAppToken AppWindowToken{d8b8747 token=Token{e013286 ActivityRecord{3279761 u0 net.jitsi.sdktest/org.jitsi.meet.sdk.JitsiMeetActivity t2613}}}
2020-10-16 16:45:24.541 1758-13591/? E/ScreenModeService: setRefreshRate token AppWindowToken{d8b8747 token=Token{e013286 ActivityRecord{3279761 u0 net.jitsi.sdktest/org.jitsi.meet.sdk.JitsiMeetActivity t2613}}} rate 1 tmpRate 2
[modules/xmpp/XmppConnection.js] Stream resume enabled, but WebSockets are not enabled
[modules/xmpp/strophe.ping.js] XMPP pings will be sent every 10000 ms
[modules/xmpp/xmpp.js] (TIME) Strophe connected:	 1602855925314
[modules/xmpp/xmpp.js] My Jabber ID: abafde23-e31f-473a-9e67-796b91d5c979@meet.jit.si/m7ealLsW
[modules/xmpp/xmpp.js] JID abafde23-e31f-473a-9e67-796b91d5c979@meet.jit.si/m7ealLsW using MUC nickname abafde23
[modules/xmpp/ChatRoom.js] Joined MUC as gbe45y3f2465hni@conference.meet.jit.si/abafde23
[modules/e2eping/e2eping.js] Initializing e2e ping; pingInterval=-1, analyticsInterval=60000.
[modules/connectivity/ParticipantConnectionStatus.js] RtcMuteTimeout set to: 10000
[JitsiConference.js] No VAD Processor was provided. Talk while muted detection service was not initialized!
[JitsiConference.js] No VAD Processor was provided. Noisy microphone detection service was not initialized!
[modules/statistics/AvgRTPStatsReporter.js] Avg RTP stats will be calculated every 15 samples
[JitsiConference.js] backToP2PDelay: 5
[modules/videosipgw/VideoSIPGW.js] creating VideoSIPGW
[JitsiConference.js] _doReplaceTrack - no JVB JingleSession

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
GemiDroidcommented, Oct 17, 2020

Hello @MarkNjunge @pworldx I found this solution may help you:

Add these dependencies:

api(platform("com.squareup.okhttp3:okhttp-bom:4.8.0"))
api("com.squareup.okhttp3:okhttp")              // No version!
api("com.squareup.okhttp3:logging-interceptor") // No version!

And remove other dependencies related to okhttp3.

1reaction
MarkNjungecommented, Oct 17, 2020

@GemiDroid That works but it ends up using okhttp 3.14.9 while my app requires features from 4.0+.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do app crashes after update from play market, but after ...
After updating from Play Market, the application does not start (it starts and immediately crashes). However, if the app is completely ...
Read more >
Firebase Android SDK Release Notes - Google
Learn how to install these SDKs in your app: Add Firebase to your Android Project. ... Updated dependency of firebase-iid to its latest...
Read more >
Mobile App Monitoring FAQ - IBM
How is beacon reporting handled? What happens for users with bad internet/network connections? What happens if reporting fails? Is data collected while offline?...
Read more >
3.x Change Log - OkHttp
Fix: Don't crash on Android 11 due to use of restricted methods. This prevents a crash ... We've added a compile-time dependency on...
Read more >
java.lang.NoSuchMethodError: no non-static method ...
I can't really say when exactly, but obviously it has something to do with the ... Object.wait(Object.java:568) runtime.cc:655] at com.android.okhttp.okio.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found