RealmSwift with Package Manager cannot find "SyncUser" in scope

Hi, I am trying to use the latest v5.3.5 RealmSwift with an existing project but get compiler errors indicating the sync components are missing:


However these are typealiased to the RMLSyncUser in the source files.

Should I be able to build the full sync client using the Package Manager installed in Xcode ? If so any idea why these are not being found ?

I’m using 10.1.2 and I also have the same problems when using Package Manager in XCode 12. Hope to hear any update on this issue.

Sync is not supported through Swift Package Manager yet, however it will be in the near future.

1 Like

@Ian_Ward - I raised a request in GitHub to get a RealmSwift binary build for Xcode 12 and you responded saying that I should download the repo and build it myself. As I understand it Sync is not supported if you do that (see above response) so that would not help since we are in production with Realm Cloud.

Wouldn’t it be pretty quick for you to build RealmSwift v4.4.1 with Xcode 12 (Swift 5.3 I believe) - rather than us having to wait for Sync to be included in Package Manager.

V5.5.x still has issues so we are not confident to use it in production while we still see random crashes - but presumably we can’t build RealmSwift with Sync for v5.5.0 either anyway.

Did I misunderstand something or is there some other way for us to build a Sync version of RealmSwift v4.4.1 for Xcode 12 - and ideally for both x86 and Apple Silicon (universal binary ?).


hey @Duncan_Groenewald - I appreciate the post.

Unfortunately, it would be a lot of work for us to make a build with a pretty old version of RealmSwift 4.4.1 that supports Apple Silicon. We’ve had to add a significant amount of build steps in order to support the new silicon. I’d encourage you to upgrade to a 5.x version of RealmSwift that works for your build requirements - if you are experiencing issues with the 5.x version of RealmSwift; let’s work through them. We are here to help.

There are two issues we are still seeing with 5.5.0

  1. Random crashes - much improved now but we still see a crash periodically when closing the application down. There seem to be a few others who have also reported these random crashes so we have not raised another issue. As soon as we get some guidance on how to migrate existing data to Mongo Realm we might just skip 5.5.0 altogether and test on 10.x
  2. Error when upgrading to 5.5.0. (RealmSwift 5.5.0 Unable to open 4.4.1 Realm file - ERROR: Key Already Used · Issue #6884 · realm/realm-swift · GitHub)

@Duncan_Groenewald For RealmSwift 5.5.0 Unable to open 4.4.1 Realm file - ERROR: Key Already Used · Issue #6884 · realm/realm-swift · GitHub

Any information you can provide to our Cocoa team will help us narrow down the issue and fix this for you. Jason asked for a stack trace, if the app is crashing, then a stacktrace should be uploaded to Fabric or similar crash reporting service. If you are able to reproduce and can provide a sample app - we fix this immediately.

I have offered to provide a realm file for 2) which you can open with Realm Studio and you get the same error (there is no crash). I need an email address and I can share a dropbox folder - the file is around 50MB so I can’t email a copy.

  1. is random and seems to be difficult to reliably reproduce because it happens when the app is closed - I’ll see if I can entice another crash this week.

Sure you can email me at