fix: [SDK-4160] exclude OkHttp 5.x from OneSignal transitive dependencies#1921
Merged
fadi-george merged 5 commits intomainfrom Mar 17, 2026
Conversation
abdulraqeeb33
approved these changes
Mar 17, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
One Line Summary
Exclude OkHttp 5.x from OneSignal Android SDK's transitive dependencies to prevent runtime crashes in React Native apps.
Details
Motivation
OneSignal Android SDK 5.7.x introduced an
otelmodule that transitively pulls in OkHttp 5.x (okhttp-jvm:5.2.1) viaopentelemetry-exporter-sender-okhttp. OkHttp 5.x is binary-incompatible with React Native's networking stack, which referencesokhttp3.internal.Util(removed in 5.x). Gradle's conflict resolution upgrades the entire app to OkHttp 5.x, causing aNoClassDefFoundErrorcrash at runtime on the first network request.Dependency chain causing the crash:
An upstream fix is also being applied to the Android SDK's
otelmodule (OneSignal-Android-SDK#2577). This wrapper-side exclude provides additional protection for React Native users.Scope
com.squareup.okhttp3:okhttpfrom the OneSignal dependency's transitive graphFixes OneSignal/OneSignal-Android-SDK#2575
Testing
Manual testing
Verified via Gradle dependency insight that OkHttp 5.x no longer appears in the resolved classpath when this exclude is applied.
Affected code checklist
Checklist
Overview
Testing
Final pass
Made with Cursor
This change is