Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancel explicit deps in okio and okhttp #1397

Merged
merged 1 commit into from
May 22, 2019
Merged

Conversation

d4vidi
Copy link
Collaborator

@d4vidi d4vidi commented May 22, 2019

Description:

Fixes #1380 and similar problems in some projects that compile Detox, typically running RN-59, maybe 58.

This explains the fix in a nutshell:

  • Using gradle's + wildcard for auto version resolution - which in facts yields the newest available version, works for react native as a dep, because RN gets resolved strictly from the synthetic node_modules/react-native/android "repo". The "newest" version is simply the one that's installed there.
  • This isn't the case for okhttp and okio, which are found at the google and/or jcenter repos. In the current setting, that basically gives Detox the mandate to claim it relies on new, perhaps incompatible versions (e.g. okhttp 4), while really it can work with anything not too old.

Luckily, okhttp and okio eventually directly and indirectly come from the dep in react native itself (e.g. via fresco), so explicitly declaring them has been rendered useless now. Example from the Detox test app:

fromBinReleaseCompileClasspath - Resolved configuration for compilation for variant: fromBinRelease
+--- com.facebook.react:react-native:+ -> 0.56.0
|    +--- javax.inject:javax.inject:1
|    +--- com.android.support:appcompat-v7:26.1.0 -> 27.1.1
|    |    +--- com.android.support:support-annotations:27.1.1
|    |    +--- com.android.support:support-core-utils:27.1.1
|    |    |    +--- com.android.support:support-annotations:27.1.1
|    |    |    \--- com.android.support:support-compat:27.1.1
|    |    |         +--- com.android.support:support-annotations:27.1.1
|    |    |         \--- android.arch.lifecycle:runtime:1.1.0
|    |    |              +--- android.arch.lifecycle:common:1.1.0
|    |    |              \--- android.arch.core:common:1.1.0
...
|    +--- com.facebook.fresco:imagepipeline-okhttp3:1.9.0
|    |    +--- com.squareup.okhttp3:okhttp:3.10.0
|    |    |    \--- com.squareup.okio:okio:1.14.0
|    |    +--- com.facebook.fresco:fbcore:1.9.0
|    |    \--- com.facebook.fresco:imagepipeline:1.9.0 (*)
|    +--- com.facebook.soloader:soloader:0.3.0
|    +--- com.google.code.findbugs:jsr305:3.0.0
|    +--- com.squareup.okhttp3:okhttp:3.10.0 (*)
|    +--- com.squareup.okhttp3:okhttp-urlconnection:3.10.0
|    |    \--- com.squareup.okhttp3:okhttp:3.10.0 (*)
|    +--- com.squareup.okio:okio:1.14.0
|    \--- org.webkit:android-jsc:r174650

@d4vidi d4vidi requested a review from rotemmiz as a code owner May 22, 2019 07:47
@d4vidi d4vidi self-assigned this May 22, 2019
@d4vidi d4vidi merged commit 2482d2a into master May 22, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 25, 2019
@LeoNatan LeoNatan deleted the rn59-dep-mismatch-fix branch July 11, 2019 09:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

android build.gradle's wildcard dependencies means builds not reproducible / fail
1 participant