I’m in 1.3.70, and even though I clearly have a de...
# multiplatform
s
I’m in 1.3.70, and even though I clearly have a dependency declared, I’m not able to resolve the coroutines lib when compiling. Has anyone seen this issue?
Copy code
Unresolved reference: coroutines
Unresolved reference: coroutines
Unresolved reference: CoroutineDispatcher
Unresolved reference: Dispatchers
Copy code
val iosMain by getting {
            dependencies {
                implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-native:${Versions.kotlinxCoroutines}")

                implementation(Deps.ktor.client.ios)
                implementation(Deps.ktor.feature.serialization.native)
            }
        }
k
is it common code, and do you have the dependency for your common source set?
b
do you have
kotlin.mpp.enableGranularSourceSetsMetadata
enabled?
s
@Kris Wong The error is happening for the iosMain sourceSet:
Copy code
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers

internal actual object Platform {
    actual val dispatcher: CoroutineDispatcher
        get() = Dispatchers.Main
}
@basher I do have
Copy code
kotlin.mpp.enableGranularSourceSetsMetadata=true
set. I was just told to by someone the jetbrains team to work around an issue
b
Removing it should fix it. I think in 1.3.70 that flag also enables common metadata compilations that needs support from downstream libraries
k
fwiw,
kotlinx-coroutines-core-native
has gradle metadata
what happens if you move that dependency to
commonMain
instead of
iosMain
?
b
what's the name of the compile task?