question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Realm (-SNAPSHOT) is incompatible with Kotlin 1.7.20-Beta

See original GitHub issue

Hi all! I’m currently using Kotlin 1.7.20-Beta (which has the new memory management model enabled by default) with Realm 1.2.0-ktor2-SNAPSHOT on a multiplatform project.

At compile time, I’ve got the following error on all the classes that are using RealmObject. All works fine downgrading to Kotlin 1.7.10, with Realm 1.2.0-ktor2-SNAPSHOT and the new memory management model enabled in gradle.proprieties.

Let me know if you need additional tests/details.

org.jetbrains.kotlin.backend.common.CompilationException: Back-end: Please report this problem https://kotl.in/issue
/Users/paolorotolo/NextomeMultiplatformSDK/nextomesdk/src/commonMain/kotlin/com/nextome/sdk/multiplatform/models/NMMachineStateEntity.kt:-1:-1
Details: Internal error in file lowering: java.lang.NoSuchMethodError: 'org.jetbrains.kotlin.ir.declarations.IrValueParameter org.jetbrains.kotlin.backend.common.ir.IrUtilsKt.copyTo$default(org.jetbrains.kotlin.ir.declarations.IrValueParameter, org.jetbrains.kotlin.ir.declarations.IrFunction, org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin, int, int, int, org.jetbrains.kotlin.name.Name, java.util.Map, org.jetbrains.kotlin.ir.types.IrType, org.jetbrains.kotlin.ir.types.IrType, org.jetbrains.kotlin.ir.expressions.IrExpressionBody, boolean, boolean, boolean, int, java.lang.Object)'
	at io.realm.kotlin.compiler.RealmModelSyntheticPropertiesGeneration.addVariableProperty(RealmModelSyntheticPropertiesGeneration.kt:613)
	at io.realm.kotlin.compiler.RealmModelSyntheticPropertiesGeneration.addRealmObjectInternalProperties(RealmModelSyntheticPropertiesGeneration.kt:171)
	at io.realm.kotlin.compiler.RealmModelLowering.lower(RealmModelLoweringExtension.kt:89)
	at org.jetbrains.kotlin.backend.common.ClassLoweringVisitor.visitClass(Lower.kt:101)
	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitClass(IrElementVisitorVoid.kt:111)
	at org.jetbrains.kotlin.backend.common.ClassLoweringVisitor.visitClass(Lower.kt:92)
	at org.jetbrains.kotlin.backend.common.ClassLoweringVisitor.visitClass(Lower.kt:92)
	at org.jetbrains.kotlin.ir.declarations.IrClass.accept(IrClass.kt:64)
	at org.jetbrains.kotlin.ir.declarations.IrFile.acceptChildren(IrFile.kt:36)
	at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptChildrenVoid(IrVisitors.kt:15)
	at org.jetbrains.kotlin.backend.common.ClassLoweringVisitor.visitElement(Lower.kt:96)
	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitPackageFragment(IrElementVisitorVoid.kt:190)
	at org.jetbrains.kotlin.backend.common.ClassLoweringVisitor.visitPackageFragment(Lower.kt:92)
	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitFile(IrElementVisitorVoid.kt:200)
	at org.jetbrains.kotlin.backend.common.ClassLoweringVisitor.visitFile(Lower.kt:92)
	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitFile(IrElementVisitorVoid.kt:198)
	at org.jetbrains.kotlin.backend.common.ClassLoweringVisitor.visitFile(Lower.kt:92)
	at org.jetbrains.kotlin.backend.common.ClassLoweringVisitor.visitFile(Lower.kt:92)
	at org.jetbrains.kotlin.ir.declarations.IrFile.accept(IrFile.kt:30)
	at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptVoid(IrVisitors.kt:11)
	at org.jetbrains.kotlin.backend.common.LowerKt.runOnFilePostfix(Lower.kt:89)
	at org.jetbrains.kotlin.backend.common.ClassLoweringPass$DefaultImpls.lower(Lower.kt:44)
	at io.realm.kotlin.compiler.RealmModelLowering.lower(RealmModelLoweringExtension.kt:47)
	at org.jetbrains.kotlin.backend.common.LowerKt.lower(Lower.kt:75)
	at io.realm.kotlin.compiler.RealmModelLoweringExtension.generate(RealmModelLoweringExtension.kt:43)
	at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.convertToIr$lambda$1(JvmIrCodegenFactory.kt:183)
	at org.jetbrains.kotlin.psi2ir.Psi2IrTranslator.generateModuleFragment(Psi2IrTranslator.kt:99)
	at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.convertToIr(JvmIrCodegenFactory.kt:215)
	at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.convertToIr(JvmIrCodegenFactory.kt:53)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.convertToIr(KotlinToJVMBytecodeCompiler.kt:230)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:113)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:58)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:158)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:53)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:99)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:47)
	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101)
	at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:475)
	at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:125)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:372)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally$default(IncrementalCompilerRunner.kt:317)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.rebuild(IncrementalCompilerRunner.kt:114)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:206)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:79)
	at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:625)
	at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:101)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1746)
	at jdk.internal.reflect.GeneratedMethodAccessor100.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.NoSuchMethodError: 'org.jetbrains.kotlin.ir.declarations.IrValueParameter org.jetbrains.kotlin.backend.common.ir.IrUtilsKt.copyTo$default(org.jetbrains.kotlin.ir.declarations.IrValueParameter, org.jetbrains.kotlin.ir.declarations.IrFunction, org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin, int, int, int, org.jetbrains.kotlin.name.Name, java.util.Map, org.jetbrains.kotlin.ir.types.IrType, org.jetbrains.kotlin.ir.types.IrType, org.jetbrains.kotlin.ir.expressions.IrExpressionBody, boolean, boolean, boolean, int, java.lang.Object)'
	... 63 more

Thanks.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
mohit-sharma-87commented, Oct 20, 2022

Someone who comes across this make sure you are using -> kotlin(“multiplatform”).version(“1.7.20”), in my case it didn’t work with 1.7.20 & Realm 1.4.0

1reaction
cmelchiorcommented, Sep 20, 2022

@paolorotolo, yes, it has been merged to the ktor2 branch as well and a SNAPSHOT has been released.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Module was compiled with an incompatible version of Kotlin ...
Happened to me when updating from Kotlin 1.4.30 to 1.5.0 . ... Change org.jetbrains.kotlin.android to 1.7.10 , like:
Read more >
Is anyone else affected by https github com google ksp issue | Ksp ...
I am planning to take a look.
Read more >
Realm: Create reactive mobile apps in a fraction of the time
MutableRealmInteger is not an immutable type standard like primitive number types in Kotlin. It is a live object like RealmObject , RealmResults and...
Read more >
WhatsNew 2.1 | Ktor Framework
Ktor client digest setting realm parameter ... Update Kotlin to 1.7.20 ... Ktor Gradle Plugin (Ktor server) is incompatible with Android ...
Read more >
docs/changelogs/ChangeLog-1.1.X.md - Kotlin - Fossies
Member "kotlin-1.7.20/docs/changelogs/ChangeLog-1.1. ... KT-17818 Formatting of long constructors is inconsistent with Kotlin code conventions ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found