hey after updating to latest kotlin and ksp versio...
# koin
a
hey after updating to latest kotlin and ksp version in multiplatform project I am getting build time error:
Copy code
* Exception is:
org.gradle.internal.execution.WorkValidationException: A problem was found with the configuration of task ':shared:kspCommonMainKotlinMetadata' (type 'KspAATask').
  - Gradle detected a problem with the following location: '..../shared/build/generated/ksp/metadata/commonMain/kotlin'.
    
    Reason: Task ':shared:kspDebugKotlinAndroid' uses this output of task ':shared:kspCommonMainKotlinMetadata' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':shared:kspCommonMainKotlinMetadata' as an input of ':shared:kspDebugKotlinAndroid'.
      2. Declare an explicit dependency on ':shared:kspCommonMainKotlinMetadata' from ':shared:kspDebugKotlinAndroid' using Task#dependsOn.
      3. Declare an explicit dependency on ':shared:kspCommonMainKotlinMetadata' from ':shared:kspDebugKotlinAndroid' using Task#mustRunAfter.
Any ideas how to fix it?
ksp = "2.1.0-1.0.29"
kotlin = "2.1.0"
These lines are causing it:
Copy code
dependencies {
    add("kspCommonMainMetadata", libs.koin.ksp.compiler)
    add("kspAndroid", libs.koin.ksp.compiler)
    add("kspIosX64", libs.koin.ksp.compiler)
    add("kspIosArm64", libs.koin.ksp.compiler)
    add("kspIosSimulatorArm64", libs.koin.ksp.compiler)
}

project.tasks.withType(KotlinCompilationTask::class.java).configureEach {
    if (name != "kspCommonMainKotlinMetadata") {
        dependsOn("kspCommonMainKotlinMetadata")
    }
}
Thanks in advance!
f
try something like this
Copy code
tasks {
    configureEach {
       if (this.name.contains("kspDebugKotlinAndroid")) {
            this.dependsOn("kspCommonMainKotlinMetadata")
        }
    }
}
you can add more conditions for the other targets.
a
I think these lines does pretty much the same?
Copy code
project.tasks.withType(KotlinCompilationTask::class.java).configureEach {
    if (name != "kspCommonMainKotlinMetadata") {
        dependsOn("kspCommonMainKotlinMetadata")
    }
}
f
no, not the same
a
thanks, where in gradle file would you suggest to add these lines?
f
inside your gradle module
The alternative way is to disable ksp2, some issues here