Hello all, I'm updating to kotlin 2 on a project a...
# multiplatform
a
Hello all, I'm updating to kotlin 2 on a project and got a weird error:
Copy code
org.jetbrains.kotlin.util.FileAnalysisException: Somewhere in file NetworkResult.kt: java.lang.NoSuchMethodError: 'org.jetbrains.kotlin.fir.types.ConeKotlinType org.jetbrains.kotlin.fir.types.FirResolvedTypeRef.getType()'
The file is a sealed class and was compiling perfectly on pre 2.0 configuration, does anyone know about this kind of issue?
The trace goes to:
K2JVMCompiler.kt
t
please create a Kotlin issue including if possible a repro
thank you color 1
s
@Alejandro Moya hello. i'm facing the same issue. did you find a solution?
t
cc @dmitriy.novozhilov
d
Do you have any compiler plugins enabled? Such exceptions usually indicate that there is a compiler plugin compiled against some older compiler version, so it's binary incompatible with the new compiler. Also the full stacktrace would be helpful
s
I was looking for a youtrack issue to put the details but unable to find it. I'm using
composeCompiler
and
kotlinSerialization
but both are updated with kotlin 2.2.0
d
Please create a new issue then
👍 1
d
As I can see, the issue is raised by the
realm
compiler plugin.
Copy code
java.lang.NoSuchMethodError: 'org.jetbrains.kotlin.fir.types.ConeKotlinType org.jetbrains.kotlin.fir.types.FirResolvedTypeRef.getType()'
	at io.realm.kotlin.compiler.IrUtilsKt.isBaseRealmObject(IrUtils.kt:225) // <--------- see the package name here
	at io.realm.kotlin.compiler.fir.model.CompanionExtension.getNestedClassifiersNames(CompanionExtension.kt:45)
s
hmm. But the realm plugin is updated into the latest version 3.0.0
d
The question is if it is compatible with 2.2.0 compiler
According to this, the latest compatible kotlin version is 2.0.20
s
thanks . So I need to downgrade. I also found a related issue in realm-kotlin: https://github.com/realm/realm-kotlin/issues/1868
👍 1
a
unfortunately realm is being abandoned, I would recommend migrating to another DB library like SQLDelight
116 Views