Realm-java: Some classes are missing from the schema for this Realm.

Created on 8 Apr 2016  路  11Comments  路  Source: realm/realm-java

@rfrost77's sent some Crashlyctics reports.

Goal

Do not encountered the following error.

Expected Results

Works well.

Actual Results

Some classes are missing from the schema for this Realm.

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{kr.co.rememberapp/kr.co.rememberapp.activity.home.SplashActivity}: io.realm.exceptions.RealmMigrationNeededException: The CardCustomDataRealm class is missing from the schema for this Realm.
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3149)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3248)
       at android.app.ActivityThread.access$1000(ActivityThread.java:197)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1681)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:145)
       at android.app.ActivityThread.main(ActivityThread.java:6872)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by io.realm.exceptions.RealmMigrationNeededException: The CardCustomDataRealm class is missing from the schema for this Realm.
       at io.realm.CardCustomDataRealmRealmProxy.validateTable(CardCustomDataRealmRealmProxy.java:197)
       at io.realm.DefaultRealmModuleMediator.validateTable(DefaultRealmModuleMediator.java:139)
       at io.realm.Realm.initializeRealm(Realm.java:315)
       at io.realm.Realm.createAndValidate(Realm.java:283)
       at io.realm.Realm.createInstance(Realm.java:262)
       at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:114)
       at io.realm.Realm.getDefaultInstance(Realm.java:195)
       at kr.co.rememberapp.activity.BaseActivity.initialize(BaseActivity.java:121)
       at kr.co.rememberapp.activity.BaseActivity.onCreate(BaseActivity.java:115)
       at kr.co.rememberapp.activity.home.SplashActivity.onCreate(SplashActivity.java:38)
       at android.app.Activity.performCreate(Activity.java:6550)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1120)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3102)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3248)
       at android.app.ActivityThread.access$1000(ActivityThread.java:197)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1681)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:145)
       at android.app.ActivityThread.main(ActivityThread.java:6872)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

See also their Crashlyctics:

Steps & Code to Reproduce

They are only reported by Crashlyctics.

Version

Which Android version and device: 4, 5, 6

T-Help

Most helpful comment

@ameersabith you need to define a migration if you add new classes etc (in non-sync realm)

All 11 comments

@rfrost77 Is is possible that some devices have upgraded the app, and that you added a number of classes and didn't write a migration step?

@dalinaum @rfrost77 Did you solve the issue? Or can you provide an example to reproduce the issue?

Closing due to no response

I meet the same problem, if you solve, please tell me , thank you in advance!

I've seen this issue caused by the broken memcpy function before 3.1.1, but otherwise it means the migration didn't run right, or a migration was not added even though it should have been.

@hjmJhon Which device and Android version do you experience this on?

Clearing the app data worked for me!

@kneth @hjmJhon I just got the same issue on a Samsung Note 5 running 7.0. I added all three of these classes at the same time (all extend RealmObject). From my understanding, Realm creates the table for new classes automatically with a bump of the schema version, and a custom migration is only needed if fields are changing within already created tables. It's complaining that there's no table for GenerationAbility.

```
public class Ability extends RealmObject {

private String name;
private RealmList<EffectEntry> effect_entries;
private GenerationAbility generation;

}

```

Realm creates the table for new classes automatically with a bump of the schema version

Only in Sync mode.

Otherwise you must specify a migration yourself and add the new classes/fields to the schema yourself through the DynamicRealm API (provided in the migration).

Caused by: io.realm.exceptions.RealmMigrationNeededException: The 'ModelItems' class is missing from the schema for this Realm.
I have this problem while running.

@ameersabith you need to define a migration if you add new classes etc (in non-sync realm)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bryanspano picture bryanspano  路  3Comments

gpulido picture gpulido  路  3Comments

mithrann picture mithrann  路  3Comments

cmelchior picture cmelchior  路  3Comments

David-Kuper picture David-Kuper  路  3Comments