Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object isnt part of the schema for this Realm #1841

Open
Aramaram174 opened this issue Sep 19, 2024 · 3 comments
Open

Object isnt part of the schema for this Realm #1841

Aramaram174 opened this issue Sep 19, 2024 · 3 comments

Comments

@Aramaram174
Copy link

How frequently does the bug occur?

Always

Description

import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import io.realm.annotations.RealmClass

@RealmClass
open class Event (
@PrimaryKey
var id: Long = 0,
var gameID: Long = 0
) :RealmObject()

Why this object is not part of the schema for this Realm?

Stacktrace & log output

FATAL EXCEPTION: DefaultDispatcher-worker-2
                                                                                                    Process: com.example.testrealm, PID: 18755
                                                                                                    io.realm.exceptions.RealmException: Event is not part of the schema for this Realm
                                                                                                    	at io.realm.internal.modules.CompositeMediator.getMediator(CompositeMediator.java:205)
                                                                                                    	at io.realm.internal.modules.CompositeMediator.isEmbedded(CompositeMediator.java:181)
                                                                                                    	at io.realm.Realm.createObject(Realm.java:1121)
                                                                                                    	at com.example.testrealm.MainActivity$addEvent$1.invokeSuspend$lambda$1$lambda$0(MainActivity.kt:22)
                                                                                                    	at com.example.testrealm.MainActivity$addEvent$1.$r8$lambda$jDJOFMmqyyuDFh97NeF17-dThAQ(Unknown Source:0)
                                                                                                    	at com.example.testrealm.MainActivity$addEvent$1$$ExternalSyntheticLambda0.execute(D8$$SyntheticClass:0)
                                                                                                    	at io.realm.Realm.executeTransaction(Realm.java:1633)
                                                                                                    	at com.example.testrealm.MainActivity$addEvent$1.invokeSuspend(MainActivity.kt:21)
                                                                                                    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
                                                                                                    	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
                                                                                                    	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
                                                                                                    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
                                                                                                    	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@cc9bcc0, Dispatchers.IO]

Can you reproduce the bug?

Always

Reproduction Steps

After run project show this bug

Version

10.11.0

What Atlas App Services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

Android 13

Build environment

Android Studio version: ...Android Studio Iguana | 2023.2.1 Patch 1, 17.0.9
Android Build Tools version: ...34
Gradle version: ...gradle-8.4-bin.zip

Copy link

sync-by-unito bot commented Sep 19, 2024

➤ PM Bot commented:

Jira ticket: RKOTLIN-1130

@Aramaram174
Copy link
Author

@galacticfungus
Copy link

You don't need @RealmClass, just

class Event() : RealmObject {
  @PrimaryKey
  var id: ObjectId = ObjectId()
  var gameId : Long = 0L
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants