Please I have this issue with realm migration error that a property has been removed, but the issue is that I never added that property mention in the realm Object. Here is the realm Object
open class FeedbackModel(
@PrimaryKey var id : Long = -1,
var agentEmail: String? = null,
var agentName: String? = null,
var agentPhone: String? = null,
var appName: String? = null,
var comment: String? = null,
var deviceId: String? = null,
var date : String? = null,
var deviceType: String? = null,
var esaCode: String? = null,
var fepName: String? = null,
var rateValue: Int = 0
) : RealmObject()
Here is the error
: 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)
Nothing like $stable property was added. Please how can I resolve this?
I noticed the same thing with realm when I initially had the class in java but migrate it to Kotlin. Even though you do not have the field ($stable) in your table, realm seems to somehow generate that className.$stable for you. So the way I solve it was that I made sure I check for it and remove it during migration process like this
make sure you add this block of code after all other fields needed in your realm object has been added.