realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.45k stars 1.75k forks source link

Migration needed due to Property removed was never added to the realm object #7737

Closed sfxbawoamewieye closed 1 year ago

sfxbawoamewieye commented 1 year ago

How frequently does the bug occur?

All the time

Description

I keep getting the exception that Migration is required due to the following errors:

Stacktrace & log output

io.realm.exceptions.RealmMigrationNeededException: Migration is required due to the following errors:
- Property 'FeedbackModel.$stable' has been removed.
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3729)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4020)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2328)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:246)
    at android.app.ActivityThread.main(ActivityThread.java:8633)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Caused by: io.realm.exceptions.RealmMigrationNeededException: Migration is required due to the following errors:
- Property 'FeedbackModel.$stable' has been removed.
    at io.realm.internal.OsSharedRealm.nativeGetSharedRealm(Native Method)
    at io.realm.internal.OsSharedRealm.<init>(OsSharedRealm.java:175)
    at io.realm.internal.OsSharedRealm.getInstance(OsSharedRealm.java:251)
    at io.realm.BaseRealm.<init>(BaseRealm.java:141)
    at io.realm.BaseRealm.<init>(BaseRealm.java:108)
    at io.realm.Realm.<init>(Realm.java:159)
    at io.realm.Realm.createInstance(Realm.java:495)
    at io.realm.RealmCache.createInstance(RealmCache.java:481)
    at io.realm.RealmCache.doCreateRealmOrGetFromCache(RealmCache.java:448)
    at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:412)
    at io.realm.Realm.getInstance(Realm.java:424)
    at utilities.DbManager.<init>(DbManager.kt:23)
    at activities.BaseActivity.<init>(BaseActivity.kt:30)
    at activities.SplashActivity.<init>(SplashActivity.kt:39)
    at java.lang.Class.newInstance(Native Method)
    at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
    at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
    at android.app.Instrumentation.newActivity(Instrumentation.java:1253)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3717)

Can you reproduce the bug?

Yes, always

Reproduction Steps

Whenever there is an update to any realm object

Version

10.6.0

What SDK flavour are you using?

Local Database only

Are you using encryption?

Yes, using encryption

Platform OS and version(s)

Android version 11

Build environment

Android Studio version: ...Chipmunk | 2021.2.1 Patch 2 Android Build Tools version: ...7.2.2 Gradle version: ...7.3.3

sync-by-unito[bot] commented 1 year ago

➤ Nabil Hachicha commented:

Hi,

Can you please share your project (or a repro sample) so we can investigate this? 

Cheers,

github-actions[bot] commented 1 year ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.