https://kotlinlang.org logo
#gradle
Title
# gradle
c

CRamsan

07/05/2022, 2:46 PM
Hello everyone. Does anyone know if there is any issues or changes to the Kotlin plugin with Kotlin 1.7? When I set my kotlin version to 1.7, several of my projects fail to configure. A common failure is this:
Copy code
Build file 'C:\Users\cesar\git\CoreProject\auraxiscontrolcenter\db-models\build.gradle' line: 13

* What went wrong:
A problem occurred evaluating project ':project'.
> No signature of method: build_b51p5sfw7s50l52yfyob77d9q.kotlin() is applicable for argument types: (build_b51p5sfw
  Possible solutions: notify(), toString(), toString(), toString(), toString(), split(groovy.lang.Closure)
This error refers to the
Copy code
apply plugin: "org.jetbrains.kotlin.multiplatform"

kotlin { <---- this is line 13
   ......
}
Going through the documentation for Gradle and the Kotlin plugins did not yield any results. I am not sure why this is breaking in 1.7.
t

tapchicoma

07/05/2022, 4:13 PM
Is it possible to share a project or, at least,
db-models/build.gradle
file?
c

CRamsan

07/05/2022, 4:18 PM
I will try to get a sample project later today. But this is my module `build.gradle`:
Copy code
ext.libraryVersionCode = 1
ext.libraryVersionName = "0.1"

apply plugin: "org.jetbrains.kotlin.multiplatform"

kotlin {
    jvm("jvm")

    sourceSets {
        all {
            languageSettings {
                useExperimentalAnnotation('kotlin.time.ExperimentalTime')
            }
        }
        commonMain {
            dependencies {
                implementation project(":framework")
                implementation packages.SqlDelightCoroutineExt
                implementation packages.KotlinxDatetime
            }
        }
        commonTest {
            dependencies {
                implementation project(":framework:test")
            }
        }
    }
}
t

tapchicoma

07/05/2022, 4:22 PM
useExperimentalAnnotation
was replaced with
optIn(..)
via KT-47763
c

CRamsan

07/05/2022, 4:24 PM
Got it! Yeah that seems to be it! Thanks Yahor!
6 Views