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

snowe

03/03/2020, 4:57 PM
I haven't touched coroutines in a while.
runBlocking
is now showing a
deprecated
warning, but I can find no information about this anywhere on the internet, not even the actual documentation https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/run-blocking.html. Anyone know what is up with
runBlocking
? What will it be in 1.4?
o

octylFractal

03/03/2020, 5:19 PM
I've not seen a depreciation warning for it, what does the full message say?
s

snowe

03/03/2020, 5:29 PM
message has been deleted
o

octylFractal

03/03/2020, 5:33 PM
you imported the wrong
runBlocking
it's from the old experimental coroutines package
s

snowe

03/03/2020, 5:35 PM
Hm. Apparently I was depending on
org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:jar:1.3.3
and it depends on
org.jetbrains.kotlinx:kotlinx-coroutines-core:jar:0.22
I added an explicit dependency on the correct coroutines core jar and it works now. thanks.
hmm. switching to that fixed the deprecation, but now I get an actual error running tests...
Copy code
java.lang.NoClassDefFoundError: kotlinx/coroutines/BuildersKt
o

octylFractal

03/03/2020, 5:51 PM
I'm surprised when you say that -jdk8 pulls in 0.22
the POM is quite clear: https://repo1.maven.org/maven2/org/jetbrains/kotlinx/kotlinx-coroutines-jdk8/1.3.3/kotlinx-coroutines-jdk8-1.3.3.pom
Copy code
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-core</artifactId>
<version>1.3.3</version>
<scope>compile</scope>
</dependency>
s

snowe

03/03/2020, 5:52 PM
yeah idk. i ran
mvn dependency:tree
and that's what I got.
super strange.
o

octylFractal

03/03/2020, 5:52 PM
perhaps -jdk8 is being pulled to a lower version for some reason?
that's probably the fix you'll need, is whatever fixes this dependency issue
not familiar enough with maven to tell you where to look though
s

snowe

03/03/2020, 5:53 PM
no worries, I'll get it.
thanks for the help
l

louiscad

03/03/2020, 7:35 PM
I'm curious to learn about your dependency setup
s

snowe

03/03/2020, 7:35 PM
what do you mean?
l

louiscad

03/03/2020, 7:36 PM
How you got to have these two dependencies in your project, I'd like to know what is the setup, and I'm also curious how it happened.
s

snowe

03/03/2020, 7:40 PM
which two dependencies? We have a java/kotlin multimodule project (maven) with a parent bom. In a submodule I specified the jdk8 coroutines library. that was it.
l

louiscad

03/03/2020, 7:41 PM
You're using maven and not Gradle?
s

snowe

03/03/2020, 7:42 PM
for this project yes.
we’re having trouble converting it to gradle
2 Views