https://kotlinlang.org logo
s

Siggi Gunnarss

08/10/2020, 7:49 PM
I'm struggling to include the sqldelight coroutine extensions in a multiplatform project. I think I have a minimal project reproducing the error here:
Copy code
buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.squareup.sqldelight:gradle-plugin:1.4.0'
    }
}

plugins {
    id 'org.jetbrains.kotlin.multiplatform' version '1.3.72'
    id('com.squareup.sqldelight') version '1.4.0'
}

repositories {
    google()
    mavenCentral()
}

kotlin {

    jvm()
    mingwX64("mingw")

    sourceSets {
        commonMain {
            dependencies {
                implementation kotlin('stdlib-common')
                implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.3.7"
                implementation "com.squareup.sqldelight:coroutines-extensions:1.4.0"

            }
        }
        jvmMain {
            dependencies {
                implementation kotlin('stdlib-jdk8')
                implementation "com.squareup.sqldelight:sqlite-driver:1.4.0"
            }
        }
        mingwMain {
            dependencies {
                implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.3.7"
                implementation "com.squareup.sqldelight:native-driver:1.4.0"
            }
        }
    }
    sqldelight {
        Database {
            packageName = "com.gunnarss.multiplatform"
        }
    }
}
The error is
Could not resolve com.squareup.sqldelight:coroutines-extensions:1.4.0.
I can either have windows as a native target OR I can get the extension, not both. If' I'm understanding the docs correctly, the above gradle should work?
2 Views