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

Running Detox build command shows following ERROR #detox #1123

Closed
Lokendra-rawat opened this issue Jan 18, 2019 · 4 comments
Closed

Running Detox build command shows following ERROR #detox #1123

Lokendra-rawat opened this issue Jan 18, 2019 · 4 comments

Comments

@Lokendra-rawat
Copy link

Lokendra-rawat commented Jan 18, 2019

Description

we are trying to add detox to our project which uses rnnv2 and running the command detox build --configuration android.emu.debug throws following error

Steps to Reproduce

run detox build --configuration android.emu.debug

Detox, Node, Device, Xcode and macOS Versions

  • Detox:10.0.2
  • React Native:0.57.8
  • Node:
  • Device:
  • Xcode:
  • macOS:

Device and verbose Detox logs

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':detox:minReactNative44DebugCompileClasspath'.
> Could not resolve com.squareup.okhttp3:okhttp:3.4.1.
  Required by:
      project :detox
   > Cannot find a version of 'com.squareup.okhttp3:okhttp' that satisfies the version constraints: 
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Constraint path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp' strictly '3.4.1' because of the following reason: minReactNative44DebugRuntimeClasspath uses version 3.4.1
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Constraint path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp' strictly '3.4.1' because of the following reason: minReactNative44DebugRuntimeClasspath uses version 3.4.1
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Constraint path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp' strictly '3.4.1' because of the following reason: minReactNative44DebugRuntimeClasspath uses version 3.4.1
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Dependency path 'App:detox:unspecified' --> 'com.facebook.react:react-native:0.57.8' --> 'com.squareup.okhttp3:okhttp:3.11.0'
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp-ws:3.4.1' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Dependency path 'App:detox:unspecified' --> 'com.facebook.react:react-native:0.57.8' --> 'com.facebook.fresco:imagepipeline-okhttp3:1.10.0' --> 'com.squareup.okhttp3:okhttp:3.10.0'
        Dependency path 'App:detox:unspecified' --> 'com.facebook.react:react-native:0.57.8' --> 'com.squareup.okhttp3:okhttp-urlconnection:3.11.0' --> 'com.squareup.okhttp3:okhttp:3.11.0'

> Could not resolve com.squareup.okio:okio:1.9.0.
  Required by:
      project :detox
   > Cannot find a version of 'com.squareup.okio:okio' that satisfies the version constraints: 
        Dependency path 'App:detox:unspecified' --> 'com.facebook.react:react-native:0.57.8' --> 'com.squareup.okio:okio:1.14.0'
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.11.0' --> 'com.squareup.okio:okio:1.14.0'
        Dependency path 'App:detox:unspecified' --> 'com.facebook.react:react-native:0.57.8' --> 'com.squareup.okhttp3:okhttp:3.11.0' --> 'com.squareup.okio:okio:1.14.0'
        Constraint path 'App:detox:unspecified' --> 'com.squareup.okio:okio' strictly '1.9.0' because of the following reason: minReactNative44DebugRuntimeClasspath uses version 1.9.0
        Constraint path 'App:detox:unspecified' --> 'com.squareup.okio:okio' strictly '1.9.0' because of the following reason: minReactNative44DebugRuntimeClasspath uses version 1.9.0

> Could not resolve com.squareup.okhttp3:okhttp:3.4.1.
  Required by:
      project :detox
      project :detox > com.squareup.okhttp3:okhttp-ws:3.4.1
   > Cannot find a version of 'com.squareup.okhttp3:okhttp' that satisfies the version constraints: 
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Constraint path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp' strictly '3.4.1' because of the following reason: minReactNative44DebugRuntimeClasspath uses version 3.4.1
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Constraint path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp' strictly '3.4.1' because of the following reason: minReactNative44DebugRuntimeClasspath uses version 3.4.1
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Constraint path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp' strictly '3.4.1' because of the following reason: minReactNative44DebugRuntimeClasspath uses version 3.4.1
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Dependency path 'App:detox:unspecified' --> 'com.facebook.react:react-native:0.57.8' --> 'com.squareup.okhttp3:okhttp:3.11.0'
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp-ws:3.4.1' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Dependency path 'App:detox:unspecified' --> 'com.facebook.react:react-native:0.57.8' --> 'com.facebook.fresco:imagepipeline-okhttp3:1.10.0' --> 'com.squareup.okhttp3:okhttp:3.10.0'
        Dependency path 'App:detox:unspecified' --> 'com.facebook.react:react-native:0.57.8' --> 'com.squareup.okhttp3:okhttp-urlconnection:3.11.0' --> 'com.squareup.okhttp3:okhttp:3.11.0'

> Could not resolve com.squareup.okhttp3:okhttp:3.11.0.
  Required by:
      project :detox > com.facebook.react:react-native:0.57.8
      project :detox > com.facebook.react:react-native:0.57.8 > com.squareup.okhttp3:okhttp-urlconnection:3.11.0
   > Cannot find a version of 'com.squareup.okhttp3:okhttp' that satisfies the version constraints: 
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Constraint path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp' strictly '3.4.1' because of the following reason: minReactNative44DebugRuntimeClasspath uses version 3.4.1
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Constraint path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp' strictly '3.4.1' because of the following reason: minReactNative44DebugRuntimeClasspath uses version 3.4.1
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Constraint path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp' strictly '3.4.1' because of the following reason: minReactNative44DebugRuntimeClasspath uses version 3.4.1
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Dependency path 'App:detox:unspecified' --> 'com.facebook.react:react-native:0.57.8' --> 'com.squareup.okhttp3:okhttp:3.11.0'
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp-ws:3.4.1' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Dependency path 'App:detox:unspecified' --> 'com.facebook.react:react-native:0.57.8' --> 'com.facebook.fresco:imagepipeline-okhttp3:1.10.0' --> 'com.squareup.okhttp3:okhttp:3.10.0'
        Dependency path 'App:detox:unspecified' --> 'com.facebook.react:react-native:0.57.8' --> 'com.squareup.okhttp3:okhttp-urlconnection:3.11.0' --> 'com.squareup.okhttp3:okhttp:3.11.0'

> Could not resolve com.squareup.okio:okio:1.14.0.
  Required by:
      project :detox > com.facebook.react:react-native:0.57.8
      project :detox > com.squareup.okhttp3:okhttp:3.11.0
   > Cannot find a version of 'com.squareup.okio:okio' that satisfies the version constraints: 
        Dependency path 'App:detox:unspecified' --> 'com.facebook.react:react-native:0.57.8' --> 'com.squareup.okio:okio:1.14.0'
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.11.0' --> 'com.squareup.okio:okio:1.14.0'
        Dependency path 'App:detox:unspecified' --> 'com.facebook.react:react-native:0.57.8' --> 'com.squareup.okhttp3:okhttp:3.11.0' --> 'com.squareup.okio:okio:1.14.0'
        Constraint path 'App:detox:unspecified' --> 'com.squareup.okio:okio' strictly '1.9.0' because of the following reason: minReactNative44DebugRuntimeClasspath uses version 1.9.0
        Constraint path 'App:detox:unspecified' --> 'com.squareup.okio:okio' strictly '1.9.0' because of the following reason: minReactNative44DebugRuntimeClasspath uses version 1.9.0

> Could not resolve com.squareup.okhttp3:okhttp:3.10.0.
  Required by:
      project :detox > com.facebook.react:react-native:0.57.8 > com.facebook.fresco:imagepipeline-okhttp3:1.10.0
   > Cannot find a version of 'com.squareup.okhttp3:okhttp' that satisfies the version constraints: 
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Constraint path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp' strictly '3.4.1' because of the following reason: minReactNative44DebugRuntimeClasspath uses version 3.4.1
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Constraint path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp' strictly '3.4.1' because of the following reason: minReactNative44DebugRuntimeClasspath uses version 3.4.1
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Constraint path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp' strictly '3.4.1' because of the following reason: minReactNative44DebugRuntimeClasspath uses version 3.4.1
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Dependency path 'App:detox:unspecified' --> 'com.facebook.react:react-native:0.57.8' --> 'com.squareup.okhttp3:okhttp:3.11.0'
        Dependency path 'App:detox:unspecified' --> 'com.squareup.okhttp3:okhttp-ws:3.4.1' --> 'com.squareup.okhttp3:okhttp:3.4.1'
        Dependency path 'App:detox:unspecified' --> 'com.facebook.react:react-native:0.57.8' --> 'com.facebook.fresco:imagepipeline-okhttp3:1.10.0' --> 'com.squareup.okhttp3:okhttp:3.10.0'
        Dependency path 'App:detox:unspecified' --> 'com.facebook.react:react-native:0.57.8' --> 'com.squareup.okhttp3:okhttp-urlconnection:3.11.0' --> 'com.squareup.okhttp3:okhttp:3.11.0'
@rotemmiz
Copy link
Member

Seems like you chose the wrong build flavour for your RN version. You should set it to "minReactNative46".
Please go over the integration docs again, it should be there.

@Lokendra-rawat
Copy link
Author

Lokendra-rawat commented Jan 21, 2019

Already did that still its not working our defaultConfig in app/build.gradle looks like this. I have alse recreated this issue in a test project https://github.com/Lokendra-rawat/rnn-detox/tree/master

  
 defaultConfig {
        applicationId "com.testrepo2"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        missingDimensionStrategy "minReactNative", "minReactNative46" //read note
        missingDimensionStrategy "RNN.reactNativeVersion", "reactNative57_5"
        testBuildType System.getProperty('testBuildType', 'debug')  //this will later be used to control the test apk build type
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    } 

@yogeshthanvi
Copy link

@Lokendra-rawat It seems ur missing some step or done with incorrect way . I suggest read the steps properly and try it again. It is working fine at my side . For react native 57 you need to upgrade android >build.gradle as
subprojects { afterEvaluate { project -> if (project.hasProperty("android")) { android { compileSdkVersion 28 buildToolsVersion "28.0.3" } } } }

Also please upgrade Android studio if its at lower version

@Lokendra-rawat
Copy link
Author

Lokendra-rawat commented Jan 21, 2019

Already did that and i've verified all the steps
our build.gradle looks like this @rotemmiz

@Lokendra-rawat It seems ur missing some step or done with incorrect way . I suggest read the steps properly and try it again. It is working fine at my side . For react native 57 you need to upgrade android >build.gradle as
subprojects { afterEvaluate { project -> if (project.hasProperty("android")) { android { compileSdkVersion 28 buildToolsVersion "28.0.3" } } } }

Also please upgrade Android studio if its at lower version

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 19
        compileSdkVersion = 27
        targetSdkVersion = 27
        supportLibVersion = "27.1.1"
    }
    ext.kotlinVersion = '1.3.0'
    repositories {
        google()
        mavenLocal()
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
        mavenLocal()
        jcenter()
        maven { url 'https://jitpack.io' }
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}

subprojects { subproject ->
    afterEvaluate {
        if ((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
            android {
                variantFilter { variant ->
                    def names = variant.flavors*.name
                    if (names.contains("reactNative51") || names.contains("reactNative55") || names.contains("reactNative57")) {
                        setIgnore(true)
                    }
                }
            }
        }
    }
}

task wrapper(type: Wrapper) {
    gradleVersion = '4.4'
    distributionUrl = distributionUrl.replace("bin", "all")
}

@lock lock bot locked as resolved and limited conversation to collaborators Jan 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants