You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiling a Realm model object with with Kotlin's K2 support will fail if other plugins adds a companion object too.
This is due to different compiler plugins not being able to detect additions made by other plugins. Filed in this issues.
The current workaround is to define a custom empty companion object. This will enable the plugins to augment the classes without causing conflicts.
@Serializable
class Sample: RealmObject {
....
companion object
}
Stacktrace & log output
IllegalStateException: Multiple plugins generated nested class with same name Companion for class /Sample:
public final companion object Companion : R|kotlin/Any| {
}
public final companion object Companion : R|kotlin/Any| {
}
Can you reproduce the bug?
Always
Reproduction Steps
Compile a project that has multiple compiler plugins that adds a companion object with K2 support. One example could be to make a RealmObject@Serialziable.
@Serializable
class Sample: RealmObject {
...
}
Version
1.12+ with K2 support
What Atlas App Services are you using?
Both Atlas Device Sync and Atlas App Services
Are you using encryption?
No
Platform OS and version(s)
All platforms
Build environment
Kotlin version: 1.9.0 with kotlin.experimental.tryK2=true
The text was updated successfully, but these errors were encountered:
Will this bug be addressed in the future or will it always be required to add an empty companion object as soon as we use other plugins like kotlinx.serialization ?
How frequently does the bug occur?
Always
Description
Compiling a Realm model object with with Kotlin's K2 support will fail if other plugins adds a companion object too.
This is due to different compiler plugins not being able to detect additions made by other plugins. Filed in this issues.
The current workaround is to define a custom empty companion object. This will enable the plugins to augment the classes without causing conflicts.
Stacktrace & log output
Can you reproduce the bug?
Always
Reproduction Steps
Compile a project that has multiple compiler plugins that adds a companion object with K2 support. One example could be to make a
RealmObject
@Serialziable
.Version
1.12+ with K2 support
What Atlas App Services are you using?
Both Atlas Device Sync and Atlas App Services
Are you using encryption?
No
Platform OS and version(s)
All platforms
Build environment
Kotlin version: 1.9.0 with
kotlin.experimental.tryK2=true
The text was updated successfully, but these errors were encountered: