Strange errors with sqldelight> Case: 1. Create...
# multiplatform
f
Strange errors with sqldelight> Case: 1. Create new multiplatform (Android/IOS) project. 2. Add sqldelight: create folder, add plugin to gradle:
Copy code
buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.squareup.sqldelight:gradle-plugin:1.1.3'
    }
}
...
apply plugin: 'com.squareup.sqldelight'
sqldelight {
    MyDatabase {
        packageName = "ru.mybase.database"
        sourceFolders = ["sqldelight"]
    }
}
...
kotlin {
...
SourceSets {
        commonMain {
            dependencies {
                implementation kotlin('stdlib-common')
                implementation "com.squareup.sqldelight:runtime-metadata:1.1.3"
            }
        }
...
All compiled and worked. 3. Add kotlinx serialization:
Copy code
buildscript {
...
    dependencies {
        --> classpath "org.jetbrains.kotlin:kotlin-serialization:1.3.40"
        classpath 'com.squareup.sqldelight:gradle-plugin:1.1.3'
    }
}
...
apply plugin: 'kotlinx-serialization'
...
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:0.11.1"
...
And we have error:
Copy code
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.squareup.sqldelight:runtime-jvm:1.1.3.
After removing serialization plugin the error remains. Tested with enableFeaturePreview("GRADLE_METADATA") and without.
y
you can't use sqldelight 1.1.3 with kotlin 1.3.40
f
How version I can use?
y
serialization 0.11.1 is also incompatible
use 1.3.31 and 0.11.0
f
Ok. Will test it. Thank you
y
I think for now all kotlin mpp libs and modules in a project should use same kotlin version
f
I change kotlin version to 1.3.31 and error remain
y
what happens if you remove that runtime-metadata dependency?
runtime
artifact dependncy should be automatically added by the sqldelight plugin (though it wont resolve the problem🤔) Also, can you provide complete build.gradle?
f
I don't understand. May be it IDEA errors? After restarting IDEA I have no error. So strange
😂 2
b
Copy code
configurations {
    compileClasspath
}
Is this in your build gradle? It’s a work around, I’m trying to find the issue, but surprisingly am having a hard time at the moment
I have also had issues with serialization
0.11.0
and had to move to
0.10.0
for my implementation
c
Same issue but restarting the ide isn't fixing... @Fail are you using serialization 0.10.0 or 0.11.0? I tried kotlin 1.3.31, serialization both 10 and 11, sqldelight 1.0.3... nothing is working