Realm-java: User is not part of the schema for this Realm。

Created on 18 Jan 2018  Â·  4Comments  Â·  Source: realm/realm-java

Goal

What do you want to achieve?

Expected Results

?

Actual Results

E.g. full stack trace with exception

Steps & Code to Reproduce

Describe your current debugging efforts.

Code Sample

> Your code here. Bigger samples should ideally be as separate Android Studio project, 
> in gists/repositories or privately at [email protected])

Version of Realm and tooling

Realm version(s): ?

Realm sync feature enabled: yes/no

Android Studio version: ?

Which Android version and device: ?

Most helpful comment

1.) are you using kotlin

  • if yes, do you apply kotlin-kapt plugin

    • if yes, do you apply kotlin-kapt before realm-android plugin

      • if no, then apply kotlin kapt before realm-android

        • if no, you need to apply kotlin-kapt plugin
  • if no, then check other options

2.) are you trying to use User class from library project's RealmModule?

  • Realm classes in Library projects must be exposed via @RealmModule and this must be set on RealmConfiguration.Builder

3.) is the User class a newly added class that was supposed to be added via a migration, but the schemaVersion was not increased and the migration was not provided?

All 4 comments

User is not part of the schema for this Realm.

1.) are you using kotlin

  • if yes, do you apply kotlin-kapt plugin

    • if yes, do you apply kotlin-kapt before realm-android plugin

      • if no, then apply kotlin kapt before realm-android

        • if no, you need to apply kotlin-kapt plugin
  • if no, then check other options

2.) are you trying to use User class from library project's RealmModule?

  • Realm classes in Library projects must be exposed via @RealmModule and this must be set on RealmConfiguration.Builder

3.) is the User class a newly added class that was supposed to be added via a migration, but the schemaVersion was not increased and the migration was not provided?

Thx, I will check the direction you provided, thanks again.

I assume the above solved your issue, if not feel free to reopen. Closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mithrann picture mithrann  Â·  3Comments

Merlin1993 picture Merlin1993  Â·  3Comments

bryanspano picture bryanspano  Â·  3Comments

tloshi picture tloshi  Â·  3Comments

iAbdulaziz picture iAbdulaziz  Â·  3Comments