I using Android Studio 1.2.2 and Realm 0.81.1. I have created a Model 'Category' as follows:
@RealmClass
public class Category extends RealmObject {
private String name;
// getter and setter
}
But I am getting java.lang.IllegalArgumentException: Category is not part of the schema for this Realm
I even enabled Annotation Processing, but the error is still persisting.
How can I solve this error? Any help is much appreciated.
Update
I dug deeper into the Realm code. I found that in Util.class file,
if(!superclass.equals(RealmObject.class)) {
clazz = superclass;
}
It is checking the superclass of the model I am using. When I printed out the super class of the mode; myself, like:
category.getClass().getSuperclass().getName();
I am getting 'io.realm.RealmObject' which is not equal to RealmObject.class. So Realm might not be considering it as a RealmObject.
Could this be the reason that is causing error?