Error code 212. message size=22,try again = 0

I am trying sync module of realm and i have setup dev mode of sync but unfunately data has not sync.
Using

Xcode 12.2

RealmSwift 10.6.0

Screenshot 2021-02-24 at 2.15.52 PM Screenshot 2021-02-24 at 2.16.10 PM

Hi Muhammad, welcome to the community!

Are you seeing any logs in you backend Realm app?

i am getting this error in Realm log activity

Ending session with error: failed to validate upload changesets: expected primary key name for AddTable instruction for top-level table to equal _id but received “” (ProtocolErrorCode=212)

Logs:

[ “Session was active for: 0s” ]

Partition:

My Project

Session Metrics:

{}

Remote IP Address:

101.53.254.85

SDK:

Realm Cocoa v10.0.0-beta.5

Platform Version:

Version 14.2 (Build 18B79)

Are you sure that you’re using realm-cocoa 10.6? I see this in your log: Realm Cocoa v10.0.0-beta.5

yes i am installing pod realmSwift and i have updated it too

You should see something like this in the logs if you’re using 10.6 image

If you’ve been making schema changes then you may have confused sync. Try deleting the app from the simulator and removing sync from your backend Realm app and then enable it again. When you install the app again, both sides of the sync will start from a clean point.

1 Like

Consider switching from Cocoa Pods to SPM – I find it much easier to work with.

can you send me latest SPM for realm

In Xcode, choose the option to add a new dependency…

… set the repo to https://github.com/realm/realm-cocoa.git and the version to 10.6 or 10.7. You can then remove the Pod

2 Likes

Thanks It has been resolved after remaking the models and schema.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.