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

spierce7

12/11/2018, 9:28 PM
When I add the following to all my submodules:
Copy code
tasks.withType(KotlinCompile) {
    kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi"]
}
I notice I get the following error in modules that don't use coroutines at all:
Copy code
e: Experimental API marker kotlinx.coroutines.ExperimentalCoroutinesApi is unresolved. Please make sure it's present in the module dependencies
Anyone know of a fix?
g

gildor

12/11/2018, 11:36 PM
Maybe you applied this compiler config to module without coroutines in dependencies? Do you use allprojects/subprojects block?
s

spierce7

12/12/2018, 1:31 AM
yes, that's exactly what I do
hmmmm, is there a way to inspect the dependencies and apply it carefully?
g

gildor

12/12/2018, 1:38 AM
I would just apply it to particular modules or add kotlinx.coroutines dependency as simple solution
s

spierce7

12/12/2018, 2:59 AM
I tried to avoid setting it manually, as my teams project has so many modules (like 50+). I'm setting it based on module project dir now. I have high hopes this will work.
yes. it worked. Thanks for all your help @gildor
👍 1