https://kotlinlang.org logo
#coroutines
Title
# coroutines
r

rsetkus

11/05/2020, 3:17 PM
Hi. Cannot sync recent coroutines native library from jcenter or maven central
Copy code
> Could not find org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.4.1.
     Searched in the following locations:
       - <https://dl.google.com/dl/android/maven2/org/jetbrains/kotlinx/kotlinx-coroutines-core-native/1.4.1/kotlinx-coroutines-core-native-1.4.1.pom>
       - <https://jcenter.bintray.com/org/jetbrains/kotlinx/kotlinx-coroutines-core-native/1.4.1/kotlinx-coroutines-core-native-1.4.1.pom>
       - <https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-coroutines-core-native/1.4.1/kotlinx-coroutines-core-native-1.4.1.pom>
Latest I can sync is
1.3.8
Used remote repositories:
Copy code
allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
}
b

Big Chungus

11/05/2020, 3:18 PM
Did you try removing your maven and gradle caches?
l

louiscad

11/05/2020, 3:19 PM
@rsetkus You are using a deprecated artifact. Remove the
-native
and it'll work.
r

rsetkus

11/05/2020, 3:29 PM
Okay that worked and now I can see that 1.4.1 is synced for every platform target but on
publishToMavenLocal
getting error
Could not find "kotlinx-coroutines-core_concurrentMain"
l

louiscad

11/05/2020, 3:30 PM
You need to enable HMPP to workaround this issue. You can search for this error message in this Slack, you'll see existing answers
r

rsetkus

11/05/2020, 3:56 PM
Sorry, HMPP? What is it?
b

Big Chungus

11/05/2020, 4:10 PM
Hierarcical Multiplatform Projects google
r

rsetkus

11/05/2020, 4:10 PM
If you mean setting those properties in gradle.properties file
Copy code
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false
It is been already done.
b

Big Chungus

11/05/2020, 4:11 PM
That's pretty much it (unless I've missed some blogpost myself)
r

rsetkus

11/06/2020, 11:27 AM
Made minimal reproducible example https://github.com/rsetkus/mre-multiplatform
build
and
publishToMavenLocal
tasks produce error
Could not find "kotlinx-coroutines-core_concurrentMain"
. Also, running test
MreTest::testSample
fails giving error
Copy code
kotlin.Error: Ktor native HttpClient requires kotlinx.coroutines version with `native-mt` suffix (like `1.3.9-native-mt`). Consider checking the dependencies.
Not sure if relevant but in dependency tree I can see that ktor is pulling
1.3.9-native-mt-2
but it is promoted to
1.4.1
because of explicit project coroutines dependency, which is version
1.4.1
.
22 Views