'Realm Android - Modules error after updating
I'm trying to update my libs and apps to support Realm 10.10.1 but I'm receiving this error: io.realm.exceptions.RealmException: com_model_SectionRealmRealmProxy is not part of the schema for this Realm
I'm already using modules method at Realm initialization, if I remove it the error message is changed to: io.realm.exceptions.RealmException: SectionRealm is not part of the schema for this Realm
It's working well with my old version of Realm, is there anything different I may do with this new version?
Below is my Realm Initialization code:
Realm.init(this);
RealmConfiguration realmConfiguration = new RealmConfiguration.Builder()
.name(BuildConfig.DB_NAME)
.allowWritesOnUiThread(true)
.allowQueriesOnUiThread(true)
.schemaVersion(ContextInfo.DATABASE_VERSION)
.modules(
Realm.getDefaultModule(),
new SectionModuleRealm())
.migration(new RealmMigration(this))
.build();
Realm.setDefaultConfiguration(realmConfiguration);
My Module class is:
@RealmModule(library = true, allClasses = true)
public class SectionModuleRealm {}
My Section class is:
public class SectionRealm extends RealmObject {
@PrimaryKey private int id;
private String name;
private String image;
private RealmList<SectionRealm> sectionList;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public RealmList<SectionRealm> getSectionList() {
return sectionList;
}
public void setSectionList(RealmList<SectionRealm> sectionList) {
this.sectionList = sectionList;
}
}
Tks,
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
