Skip to content

[Bug]: OneSignal 5.7.1 causes OkHttp runtime incompatibility crash in React Native app (NoClassDefFoundError okhttp3/internal/Util) #2575

Closed
OneSignal/react-native-onesignal
#1921

Description

@azcion

What happened?

After upgrading react-native-onesignal from 5.3.2 to 5.3.3, our Android app started crashing at startup with:

java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/Util;

Sentry points to:

  • okhttp3.JavaNetCookieJar.decodeHeaderAsJavaNetCookies
  • com.facebook.react.modules.network.ReactCookieJarContainer.loadForRequest

The crash happens on the OkHttp dispatcher thread shortly after launch when network/cookie handling runs.

Environment:

  • React Native: 0.84.1
  • react-native-onesignal: 5.3.3 (problematic), 5.3.2 (works)
  • OneSignal Android SDK transitively used by RN plugin:
    • 5.7.1 via RN OneSignal 5.3.3 (crashes)
    • 5.6.2 via RN OneSignal 5.3.2 (stable)

What we observed in dependency resolution:

  • ./gradlew :app:dependencyInsight --configuration mojakrkaReleaseRuntimeClasspath --dependency com.squareup.okhttp3:okhttp
  • Selected by conflict resolution: com.squareup.okhttp3:okhttp:5.2.1 (between 5.2.1, 4.9.2, 3.14.9)
  • React Native networking stack still includes okhttp-urlconnection:4.9.2

This appears to create a runtime-incompatible mix that triggers the crash.

Steps to reproduce?

1. Use a React Native 0.84.x Android app with OneSignal integrated via react-native-onesignal.
2. Set react-native-onesignal to 5.3.3.
3. Build/install Android release app.
4. Launch app and let first network requests run (cookie handling path).
5. Observe crash: NoClassDefFoundError: okhttp3/internal/Util
6. Run dependency insight and observe resolved OkHttp 5.2.1.
7. Downgrade to react-native-onesignal@5.3.2 (OneSignal Android 5.6.2) and rebuild.
8. Crash disappears; OkHttp resolves to 4.9.2.

What did you expect to happen?

Upgrading OneSignal should not introduce a transitive dependency combination that causes runtime crashes in a standard React Native Android networking setup. The app should start and handle network/cookies without crashing.

OneSignal Android SDK version

5.7.1 (transitively via react-native-onesignal@5.3.3)

Android version

14

Specific Android models

* Samsung Galaxy A72 (SM-A725F)

Relevant log output

Sentry event:
- event_id: 4be07a6babaa4303a702c18c0f3cd524
- datetime: 2026-03-12T14:52:44.305000+00:00
- release: biz.krka.mojakrka@1.0.5+91
- title: NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/Util;

Stack (trimmed):
java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/Util;
  at okhttp3.JavaNetCookieJar.decodeHeaderAsJavaNetCookies(JavaNetCookieJar.kt:81)
  at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.kt:59)
  at com.facebook.react.modules.network.ReactCookieJarContainer.loadForRequest(ReactCookieJarContainer.kt:37)
  at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:75)
  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:126)
  at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:74)
  at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:208)
  at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:529)

Caused by:
java.lang.ClassNotFoundException: okhttp3.internal.Util


Dependency insight excerpt (failing setup):
com.squareup.okhttp3:okhttp:5.2.1
Selection reasons:
  - By conflict resolution: between versions 5.2.1, 4.9.2 and 3.14.9


Dependency insight excerpt (working setup after downgrade):
com.squareup.okhttp3:okhttp:4.9.2
Selection reasons:
  - By conflict resolution: between versions 4.9.2 and 3.14.9

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. self-assigned this
    on Mar 17, 2026
  2. fadi-george commented on Mar 17, 2026

    @fadi-george
    Contributor

    Thanks for the report, working on fix for this.

  3. added a commit that references this issue on Mar 17, 2026
    e6d0976
  4. fadi-george commented on Mar 17, 2026

    @fadi-george
    Contributor

    Should be fixed in RN 5.3.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions