How to set koin-annotations with Kotlin 2.1.20-RC2...
# koin
f
How to set koin-annotations with Kotlin 2.1.20-RC2? After upgrading to 2.1.20-RC2, it build failed:
Copy code
Reason: Task ':composeApp:kspDebugKotlinAndroid' uses this output of task ':composeApp: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 ':composeApp:kspCommonMainKotlinMetadata' as an input of ':composeApp:kspDebugKotlinAndroid'.
      2. Declare an explicit dependency on ':composeApp:kspCommonMainKotlinMetadata' from ':composeApp:kspDebugKotlinAndroid' using Task#dependsOn.
      3. Declare an explicit dependency on ':composeApp:kspCommonMainKotlinMetadata' from ':composeApp:kspDebugKotlinAndroid' using Task#mustRunAfter.
After removing this, it will not have the above error. Should I replace it in a new way?
Copy code
project.tasks.withType(KotlinCompilationTask::class.java).configureEach {
    if (name != "kspCommonMainKotlinMetadata") {
        dependsOn("kspCommonMainKotlinMetadata")
    }
}
👍 1
Kotlin 2.1.20 is release, is there any way to set koin-annotations?
k
Not sure if there is a any new way, but I removed the above block and it fixed the error. From my understanding, this was just a work around for KSP. So probably it has been fixed on the latest versions.
f
This code cannot be deleted because it will affect the generation of ksp code of Android target. You can clean build and try again.
k
@FlowFan what error do you get when you remove?
f
If use ksp generated code, such as defaultModule, the error is Unresolved reference 'ksp'.
The error is related to ksp2. When I delete
ksp.useKSP2=true
, it build successed.
👌 1