Cannot update kotlin to v1.3.50 for multiplatform project

Viewed 279

I'm using kotlin 1.3.41 for my multiplatform project (included ios, jvm, js) and everything is ok. Now I'm trying to update to the latest version 1.3.50 but get this error:

Could not determine the dependencies of task ':kotlinNpmInstall'.
> org.jetbrains.kotlin.gradle.targets.js.npm.KotlinNpmResolutionManager$ResolutionState$Installed cannot be cast to org.jetbrains.kotlin.gradle.targets.js.npm.KotlinNpmResolutionManager$ResolutionState$Configuring

I have tried to search everywhere (github, kotlin issue tracker) but got nothing. Does anyone know what causes this error? Thanks.

Part of my configuration:

Root project configuration

buildscript {
  apply from: "buildsystem/dependencies.gradle"

  repositories {
    google()
    jcenter()
    mavenCentral()
    maven { url "https://dl.bintray.com/kotlin/kotlinx/" }
    maven { url "https://plugins.gradle.org/m2/" }
  }

  dependencies {
    classpath deps.gradlePlugins.android
    classpath deps.gradlePlugins.androidNavigation
    classpath deps.gradlePlugins.node
    classpath deps.gradlePlugins.kotlin
    classpath deps.gradlePlugins.kotlinSerialization
    classpath deps.gradlePlugins.kotlinAtomicfun
    classpath deps.gradlePlugins.dokka
  }
}

Multiplatform module configuration

apply plugin: 'org.jetbrains.kotlin.multiplatform'

apply plugin: 'kotlinx-serialization'

kotlin {
  targets {
    jvm("jvm")
    js("js") {
      nodejs {}
    }
    iosArm64("ios64")
    iosX64("iosSim")
    configure([ios64, iosSim]) {
      binaries.framework {
        baseName = "LIB"
      }
    }
  }

  sourceSets {
    def commonDependencies = rootProject.ext.deps.common
    commonMain {
      dependencies {
        implementation commonDependencies.kotlin
        implementation commonDependencies.kotlinCoroutines
      }
    }
    commonTest {
      dependencies {
        implementation commonDependencies.kotlinTest
        implementation commonDependencies.kotlinTestAnnotations
        implementation commonDependencies.mockk
      }
    }

    def jvmDependencies = rootProject.ext.deps.jvm
    jvmMain {
      dependencies {
        implementation jvmDependencies.kotlin
        implementation jvmDependencies.kotlinCoroutines
      }
    }
    jvmTest {
      dependencies {
        implementation jvmDependencies.kotlinTest
        implementation jvmDependencies.kotlinTestJunit
        implementation jvmDependencies.kotlinCoroutinesTest
        implementation jvmDependencies.mockk
      }
    }

    def jsDependencies = rootProject.ext.deps.js
    jsMain {
      dependencies {
        implementation jsDependencies.kotlin
        implementation jsDependencies.kotlinCoroutines
        // npm
        implementation npm("uuid", "^3.3.2")
      }
    }
    jsTest {
      dependsOn jsMain
      dependsOn commonMain
      dependencies {
        implementation jsDependencies.kotlinTest
      }
    }

    def iosDependencies = rootProject.ext.deps.ios
    iosMain {
      dependencies {
        implementation iosDependencies.kotlinCoroutines
      }
    }

    ios64Main {
      dependsOn iosMain
    }

    iosSimMain {
      dependsOn iosMain
    }
  }
}
// other configuration
1 Answers

I can confirm that the issue is in Android Studio.

When I run the official KotlinJS react app tutorial on IntelliJ, the app works. But on AS, I get the above error when executing any Gradle task dependent on npm.

Until the issue is resolved, I recommend using the Community version of IntelliJ. You can download it here

Related