I'm having an issue getting gradle to build a KMM ...
# multiplatform
b
I'm having an issue getting gradle to build a KMM app. Targeting Android, Desktop, Server. Whenever I add
sqldelight
plugin to the
composeApp
build.gradle.kts
it spits out this error:
Copy code
Using 'compilerOptions(KotlinCommonCompilerOptions.() -> Unit): Unit' is an error. Kotlin target level compiler options DSL is not available in this release!
a
what kotlin version are you running?
kotlin("plugin.serialization") version "1.9.10" why is this separate ?
of the kotlin version
Afaik this block here
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
}
b
I have no idea what I'm doing. New to everything with developing on this platform
a
is after kotlin 2.0
I think this is where your error comes from
b
I have experience with Android development back in 2018. Java and xml and it'll all look ancient compared to 2024 dev with these toolings. Any help would be appreciated
a
you need to upgrade to k2.0 to bypass this issue
or revert the compiler option block
b
Okay. I'll look into upgrading Kotlin. Thanks
a
kotlin("plugin.serialization") version "1.9.10" move this to alias() block from your libs file
link the kotlin version from the libs file
b
I don't see an
alias()
block
a
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.compose.compiler)
kotlin("plugin.serialization") version "1.9.10"
id("app.cash.sqldelight") version "2.0.2"
b
That's the same block
a
just have one source of truth for you kotlin version
inside your libs file
where the versions are located
b
kotlin = "2.0.0"
It seems I'm already on
2.0
so it sounds like I should try to use that version for serialization
Will try now
Resolved. Build succeeds. Thank you 👍
924 Views