Thread
#multiplatform
    spierce7

    spierce7

    2 years ago
    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?
    Unresolved reference: coroutines
    Unresolved reference: coroutines
    Unresolved reference: CoroutineDispatcher
    Unresolved reference: Dispatchers
    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)
                }
            }
    Kris Wong

    Kris Wong

    2 years ago
    is it common code, and do you have the dependency for your common source set?
    b

    basher

    2 years ago
    do you have
    kotlin.mpp.enableGranularSourceSetsMetadata
    enabled?
    spierce7

    spierce7

    2 years ago
    @Kris Wong The error is happening for the iosMain sourceSet:
    import kotlinx.coroutines.CoroutineDispatcher
    import kotlinx.coroutines.Dispatchers
    
    internal actual object Platform {
        actual val dispatcher: CoroutineDispatcher
            get() = Dispatchers.Main
    }
    @basher I do have
    kotlin.mpp.enableGranularSourceSetsMetadata=true
    set. I was just told to by someone the jetbrains team to work around an issue
    b

    basher

    2 years ago
    Removing it should fix it. I think in 1.3.70 that flag also enables common metadata compilations that needs support from downstream libraries
    Kris Wong

    Kris Wong

    2 years ago
    fwiw,
    kotlinx-coroutines-core-native
    has gradle metadata
    what happens if you move that dependency to
    commonMain
    instead of
    iosMain
    ?
    b

    basher

    2 years ago
    what's the name of the compile task?