Detox: Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:1.3.41.

Created on 2 Oct 2019  路  11Comments  路  Source: wix/Detox

Describe the bug

App with detox==14.3.3 can't build.

To Reproduce

  1. $ yarn detox build -c android.emu.debug
(...)
Dependency path 'celo:app:unspecified' --> 'com.wix:detox:14.3.4' --> 'org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.3.41' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.41'
        Dependency path 'celo:app:unspecified' --> 'com.wix:detox:14.3.4' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.0' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.2.0'
        Dependency path 'celo:app:unspecified' --> 'com.wix:detox:14.3.4' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.0' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.0' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.2.0'

> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:1.3.41.
  Required by:
      project :app > org.jetbrains.kotlin:kotlin-stdlib:1.3.41
   > Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib-common' that satisfies the version constraints:
        Dependency path 'celo:app:unspecified' --> 'celo:react-native-webview:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.41' --> 'org.jetbrains.kotlin:kotlin-stdlib-common:1.3.41'
        Dependency path 'celo:app:unspecified' --> 'com.wix:detox:14.3.4' --> 'org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.3.41' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.41' --> 'org.jetbrains.kotlin:kotlin-stdlib-common:1.3.41'
        Constraint path 'celo:app:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-common' strictly '1.3.21' because of the following reason: debugRuntimeClasspath uses version 1.3.21
        Constraint path 'celo:app:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-common' strictly '1.3.21' because of the following reason: debugRuntimeClasspath uses version 1.3.21
        Constraint path 'celo:app:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-common' strictly '1.3.21' because of the following reason: debugRuntimeClasspath uses version 1.3.21


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 14s

Expected behavior

Should build.

Environment (please complete the following information):

  • Detox: 14.3.3
  • React Native: 0.59.10
  • Node: 10.16.3
  • Device: -
  • OS: MacOs 10.14.6 (18G95)

Device and Verbose Detox Logs
Provide the device and "trace" Detox logs so we can understand what happened. You can obtain them by passing the loglevel param: detox test --loglevel trace

triagbug android 馃彋 stale

Most helpful comment

Try to change your Kotlin version to 1.3.41. That did the trick for me!

All 11 comments

Did you finish 100% of the setup phase in https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md ?
It seems like you have issues with resolving Google's maven repo here:

allprojects {
    repositories {

Try to change your Kotlin version to 1.3.41. That did the trick for me!

Our build.gradle looks like this:

allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
            url "$rootDir/../../../node_modules/detox/Detox-android"
        }
        flatDir {
            dirs celoClientDirectory
        }
      }
}

React Native WebView has a property kotlinVersion which you can use, so they will respect the version you specified.

For example:

buildscript {
    ext {
        buildToolsVersion = "29.0.2"
        minSdkVersion = 23
        compileSdkVersion = 29
        targetSdkVersion = 29
        supportLibVersion = "28.0.0"
        kotlin_version = "1.3.50"
        kotlinVersion = "$kotlin_version"
    }
    repositories {
        google()
        mavenLocal()
        mavenCentral()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.2'
        classpath 'io.fabric.tools:gradle:1.31.0'
    }
}

I have this currently:

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
        kotlinVersion = '1.3.0'
        detoxKotlinVersion = '1.3.0'
        // Must pin to 16 because 17 uses androidX
        googlePlayServicesVersion = "16.+"
}

(...)
dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
        classpath 'com.google.gms:google-services:4.2.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
    }

Is there's a problem with that?

@martinvol react native webview and detox both seem to require higher version of kotlin.

Maybe you can try to change the version to the latest 1.3.50 or at least 1.3.41 (react native webview's, which is higher).

Is that stated in the docs somewhere? Shall I send a PR to update it?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.

Thank you for your contributions!

For more information on bots in this reporsitory, read this discussion.

@martinvol in case of a discrepancy in kotlin's version, please try to apply a fix in the spirit of the solution description in Detox' Android troubleshooting guide. The bottom line here is that all dependency declarations in libraryX or libraryY (Kotlin in our case) must either align to the same version, or be dismissed.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.

Thank you for your contributions!

For more information on bots in this reporsitory, read this discussion.

The issue has been closed for inactivity.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rborn picture rborn  路  3Comments

aamorozov picture aamorozov  路  3Comments

carlosalmonte04 picture carlosalmonte04  路  4Comments

rengarima picture rengarima  路  4Comments

alexmngn picture alexmngn  路  3Comments