Hi there, we are trying to update to kotlin 2.0.0 ...
# ksp
s
Hi there, we are trying to update to kotlin 2.0.0 in our of our KMM project, and we are using the ktorfit-ksp dependency as shown in below SS1, We are seeing weird error while running the build both on iOS and Android plugin used
Copy code
id("com.google.devtools.ksp") version "2.0.0-1.0.21"
dependency used
Copy code
de.jensklingenberg.ktorfit:ktorfit-ksp:2.0.0-rc01
Can someone help to know why are seeing mutation of attributes is not allowed in our mobile builds, SS2 -> Android error log SS3 -> iOS error log
post adding flag
Copy code
ksp.useKSP2=true
above error disappeared and started seeing new error
e: [ksp] java.lang.NullPointerException: null cannot be cast to non-null type org.jetbrains.kotlin.load.java.structure.impl.JavaClassImpl
> Task :pitaraShared:iosArm64ResolveResourcesFromDependencies UP-TO-DATE
error: null cannot be cast to non-null type org.jetbrains.kotlin.load.java.structure.impl.JavaClassImpl
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':pitaraShared:kspKotlinIosSimulatorArm64'.
> A failure occurred while executing com.google.devtools.ksp.gradle.KspAAWorkerAction
> null cannot be cast to non-null type org.jetbrains.kotlin.load.java.structure.impl.JavaClassImpl
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at <https://help.gradle.org>.
BUILD FAILED in 9s
23 actionable tasks: 3 executed, 20 up-to-date
I think while updating Kotlin 2.0.0, we hit blocker, When we update Kotlin2 Our app dependent on Ktorfit Ktorfit dependent on KSP2 KSP2 has an null pointer issue on non-JVM targets(in our case iOS app breaks). Which they already mentioned in their milestone for KSP2.1. So until KSP2.1 released with fixes, we couldn't use Kotlin2,
j
You should be fine just updating to Kotlin 2.0 while still using KSP1, just remove useKSP2=true and KSP will fallback to use KSP1 which should be fine. Also note that the issue you linked is actually not a KSP2 specific issue, it is also present in KSP1 and requires a compiler fix.
s
@Rohit ^
r
this is happening when we are going to ksp1 mutation of attribution not allowed
s
@Jiaxiang as Rohit mentioned when we remove the flag
useKSP2=true
we are seeing
mutation of attribution not allowed
.
should we need to wait for updates?
360 Views