I am trying to open the realm file locally through realm object server but I am getting this exception :

History type (as specified by the Replication implementation passed to the SharedGroup constructor) was not consistent across the session

Also in my realm object server I can see my realm file but inside that i couldn't find any schema attached my code

public class InvolveUsers extends RealmObject  {

private String name;
private String email;
private String password;
private String role;
private String educator;
private boolean isActive;

public InvolveUsers(){

}

public String getName() {
    return name;
}

public void setName(String name) {
    this.name = name;
}

public String getEmail() {
    return email;
}

public void setEmail(String email) {
    this.email = email;
}

public String getPassword() {
    return password;
}

public void setPassword(String password) {
    this.password = password;
}

public String getRole() {
    return role;
}

public void setRole(String role) {
    this.role = role;
}

public String getEducator() {
    return educator;
}

public void setEducator(String educator) {
    this.educator = educator;
}

public boolean getIsActive() {
    return isActive;
}

public void setIsActive(boolean isActive) {
    this.isActive = isActive;
}

}

public class RealAsyncTask extends AsyncTask<String, Void, String> {

Realm realm;
String url = "http://localhost:9080/auth";
long schemaVersion = 042;

@Override
protected String doInBackground(String... strings) {
    try {
        Realm.init(getApplicationContext());
        SyncCredentials syncCredentials = SyncCredentials.usernamePassword("realm-admin","password",false);
        SyncUser user = SyncUser.login(syncCredentials, serverUrl());
        SyncConfiguration config = new SyncConfiguration.Builder(user, realmUrl())
                //.name("involve.realm")
               /* .modules(new DefaultModule())*/
                .build();
        realm.setDefaultConfiguration(config);
    }
    catch (Exception e){
        e.getCause();
    }
    return null;
}

private String realmUrl() {
    return url;
}

private String serverUrl() {
    return url;
}


realm = Realm.getDefaultInstance();
    realm.beginTransaction();
    InvolveUsers involveUsers = realm.createObject(InvolveUsers.class);
    String nameU = name.getText().toString();
    involveUsers.setName(nameU);
    involveUsers.setIsActive(true);
    involveUsers.setEmail(email.getText().toString());
    involveUsers.setRole(userRole.getSelectedItem().toString());
    realm.insert(involveUsers);
    realm.commitTransaction();
    realm.getSchema().getClass();
    Toast.makeText(getApplicationContext(),"Data stored",Toast.LENGTH_LONG).show();
0

There are 0 best solutions below