Realm object server: failed asserting left.optional == right.optional (sync data between Android & iOS)
<p>I am trying to synchronise data between my iOS Application and Android application. The Android application can read from the Realm just fine, but my Swift program is struggling, and the error message is not very informative.</p>

<p>I am receiving this error message:</p>

<pre><code>2016-11-08 08:53:43.919 iOSRealm[2629:65667] Sync: Connection[1]: Session[1]: Bad changeset received: Assertion failed: left().nullable == right().nullable
</code></pre>

<p>I have no idea what it means or how to fix it.
This is how I authenticate myself with the Realm Object server:</p>

<pre><code>private func synchronouslyLogInUser() throws {
    SyncUser.authenticateWithCredential(Credential.usernamePassword(username, password: password, actions:.UseExistingAccount), authServerURL: authURL) { (user, error) in
        print("sent login request")
        if let user = user {
            print("user was not nil")
            self.setDefaultRealmConfiguration(user)
        }
        if let error = error where error.code == SyncError.HTTPStatusCodeError.rawValue &amp;&amp; (error.userInfo["statusCode"] as? Int) == 400 {
            print("invalid user and pass")
        } else {
            print(error)
        }
    }
}

private func setDefaultRealmConfiguration(user: SyncUser) {
    Realm.Configuration.defaultConfiguration = Realm.Configuration(syncConfiguration: (user, realmURL), objectTypes: [Weather.self, Wind.self])
    Realm.Configuration.defaultConfiguration.deleteRealmIfMigrationNeeded = true
    realm = try! Realm()
}
</code></pre>

<p>I see output being printed to the console so I know the login attempt was successful. I don't think it's a problem with a mismatching database, because I set the <code>deleteRealmIfMigrationNeeded</code> flag to <code>true</code>.</p>

<p>What does this error message mean and how do I fix it?</p>

<p>The appropriate Object Realm Server logs can be found here: <a href="http://pastebin.com/raw/J9mU4H0u" rel="nofollow noreferrer">http://pastebin.com/raw/J9mU4H0u</a> - my apologies for the off-site link, but it's a long log file.</p>

<p>My Swift models are as follows:</p>

<pre><code>class Weather : Object {
    dynamic var id = 0
    dynamic var date = ""
    dynamic var forecast = ""
    dynamic var humidity = ""
    dynamic var wind: Wind!

    override class func primaryKey() -&gt; String? {
        return "id"
    }
}

class Wind: Object {
    dynamic var direction = ""
    dynamic var speed = ""
}
</code></pre>

<p>Android Models:</p>

<pre><code>public class Weather extends RealmObject {
    @PrimaryKey
    public int id;
    public String date;
    public String forecast;
    public String humidity;
    public Wind wind;
}

public class Wind extends RealmObject {
    public String direction;
    public String speed;
}
</code></pre>

<p>Thanks in advance!</p>