I have KSP in KMP project and I’m getting `Cannot ...
# ksp
v
I have KSP in KMP project and I’m getting
Cannot change attributes of dependency configuration ':<module>:iosApiElements' after it has been resolved
in Gradle configuration phase with 1.8.10-1.0.9 after upgrading from 1.7.21-1.0.8. It goes away if I remove
kspIos
dependency.
kspAndroid
works fine either way. And I can’t reproduce in official multiplatform sample in KSP repo unfortunately. Maybe someone has a clue where to look for a problem in my project configuration?
t
I think this thread is related
v
I fixed it. In my case I was doing
Copy code
project.afterEvaluate {
    project.tasks.withType(KotlinCompile) { ... }
}
And the fix is
Copy code
project.afterEvaluate {
    project.tasks.withType(KotlinCompile).configureEach { ... }
}
(the part
project.afterEvaluate
may not be relevant to the issue) So, considering the thread above, the problem apparently is that the first variant triggers configuration of all
KotlinCompile
tasks eagerly, and the second variant enables configuration avoidance/laziness. Tricky!
114 Views