jean

    jean

    1 year ago
    I’m trying to tesmsqldelight code the same way it is done there : https://github.com/touchlab/KaMPKit/blob/main/shared/src/commonTest/kotlin/co/touchlab/kampkit/SqlDelightTest.kt but I get the following error. Any idea what I’m doing wrong?
    kotlin.IllegalStateException: There is no event loop. Use runBlocking { ... } to start one.
    Osman Saral

    Osman Saral

    1 year ago
    I think you're running ios tests. can you try to change dispatcher to
    Dispatchers.Default
    ?
    o

    okarm

    1 year ago
    Ensure that you pull the
    -native-mt
    dependency on native targets.
    val iosMain by getting {
        dependencies {
            implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core") {
                version {
                    strictly("${Libs.KotlinX.Coroutines.version}-native-mt")
                }
            }
        }
    }
    jean

    jean

    1 year ago
    ah right, i remember commenting here I had an issue with
    Dispatchers.Default
    and someone answering to not use Main since it’s not available for native, unless using native-mt. I’ll revert to the main dispatcher + native-mt and give it a go, thanks 🙂
    o

    okarm

    1 year ago
    jean

    jean

    1 year ago
    yes i just checked that, and i am using default right now. So I’ll reverse to using main + native-mt
    o

    okarm

    1 year ago
    Hopefully in a year from now we'll all be using the new memory model, not worrying about custom forks!
    l

    leandro

    1 year ago
    Is it possible to force “native-mt” only for ios? or must calling the strict version be on commonMain’s dependencies?
    jean

    jean

    11 months ago
    Follow up on this after focusing all my tests pass correctly for android. I still run in the same error. I did set my dependencies for ios as @okarm suggested, but it crashes the build with the following error :
    Could not resolve all files for configuration ':iosCompileKlibraries'.
       > Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2.
    and using native-mt + Main or Default dispatcher still end up in the same
    There is no event loop. Use runBlocking { ... } to start one.
    error