I added a new simple RealmObject class (IoSteps) with just two integer fields and I keep getting a RealmMigrationNeededException. I have tried the suggestion here which is to use .deleteRealmIfMigrationNeeded() however, I continue to get the same error. And when I delete the class, the error goes away. Note that there are other RealmObject classes that have previously created. These are unchanged and I don't get any error having them in the code, only when I try to add a new RealmObject class. Below is my stacktrace:
08-10 12:45:48.972 18196-18196/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.fanny.traxivity, PID: 18196 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.fanny.traxivity/com.fanny.traxivity.view.LoginActivity}: io.realm.exceptions.RealmMigrationNeededException: The 'IoSteps' class is missing from the schema for this Realm. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2924) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2985) at android.app.ActivityThread.-wrap14(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1635) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6692) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358) Caused by: io.realm.exceptions.RealmMigrationNeededException: The 'IoSteps' class is missing from the schema for this Realm. at io.realm.IoStepsRealmProxy.validateTable(IoStepsRealmProxy.java:151) at io.realm.DefaultRealmModuleMediator.validateTable(DefaultRealmModuleMediator.java:68) at io.realm.Realm.initializeRealm(Realm.java:480) at io.realm.Realm.createAndValidateFromCache(Realm.java:423) at io.realm.Realm.createInstance(Realm.java:387) at io.realm.RealmCache.doCreateRealmOrGetFromCache(RealmCache.java:346) at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:284) at io.realm.Realm.getInstance(Realm.java:301) at com.fanny.traxivity.view.LoginActivity.onCreate(LoginActivity.java:53) at android.app.Activity.performCreate(Activity.java:6912) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2877) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2985) at android.app.ActivityThread.-wrap14(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1635) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6692) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)