Hey there, does somebody know, why this gradle bui...
# multiplatform
m
Hey there, does somebody know, why this gradle build error occures on every second build? If I execute
gradle clean
and run the application the first time, it works. The second run results in that error.
Bildschirmfoto 2023-10-17 um 16.44.42.png
e
I have a workaround in our codebase,
Copy code
// Work around <https://youtrack.jetbrains.com/issue/KT-61273|https://youtrack.jetbrains.com/issue/KT-61273>
// Remove after upgrading to Kotlin 1.9.20
tasks.withType<org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile<*>>().configureEach {
    val snapshotsDir = layout.buildDirectory.dir("snapshot/kotlin/$name")
    doFirst {
        snapshotsDir.get().asFile.mkdirs()
    }
}
m
Where's it placed? In the android build gradle?
e
in all the
build.gradle.kts
files for modules with kotlin compilations. (or in the root build wrapped in
allprojects {}
, if you set up the classpath right to avoid conflicts, but that's not good practice in general)
👍 1