It's now impossible to build RealmSwift embedded via Swift Package Manager. Xcode produce an error
Build my app which embed Realm as a Swift Package.
Successful build


Import Realm-cocoa via SwiftPackageManager in your project and try to build the project. Xcode produce a "lexical or preprocessor issue" because it does not found "assert.hpp".
ProductName: Mac OS X
ProductVersion: 10.15
BuildVersion: 19A582a
/Applications/Xcode.app/Contents/Developer
Xcode 11.1
Build version 11A1027
/usr/local/bin/pod
1.8.4
Realm (3.19.0)
RealmSwift (3.19.0)
/bin/bash
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
/usr/local/bin/carthage
0.33.0
(not in use here)
/usr/bin/git
git version 2.21.0 (Apple Git-122)
```
Realm framework version: 3.19.1
Xcode version: 11.1
iOS/OSX version: Try to build for iOS 13.1
Dependency manager + version: Swift Package Manager
I am seeing the same issue.
STR:
'realm/util/assert.hpp' file not foundIt builds fine for iOS, tvOS, or macOS apps, but if I add the libs to the watch target, the error occurs. If the error doesn't show, doing a clean build causes the error to show again.
For me also
Having the same issue.
Any progress with it? I am use Watch target and can't use catalyst with installing realm with CocoaPods.
When try instal via SPM I get errors:
'realm/util/assert.hpp' file not found
@mlenarto write step by step for reproduce it.
No progress for the moment but a really ugly solution to create an Watch App and a Catalyst App on the same project with Realm :
I hope it helps you,
Still waiting a fix for that annoying bug...
@RomainPct great idea!
I will try it now) Thanks.
➤ Lee Maguire commented:
Hi,
I cannot reproduce this issue with the latest version (Realm 4.3.2, RealmCore 5.23.8)
Thanks
Here are my steps:
Include Realm via File->Swift Packages->Add Package Dependancy

Make sure Realm and RealmSwift are added in your Watch apps Frameworks, Libraries & Embedded Content section of the watch target.

This is still an issue with Realm 4.3.2, RealmCore 5.23.8. We had to change to CocoaPods for Realm for now in order to not block our builds...
I'm getting this error too. I'll have to switch to Carthage until this is fixed.
https://github.com/realm/realm-js/issues/1449
https://github.com/realm/realm-js/issues/2617
https://github.com/realm/realm-js/issues/1427
https://github.com/realm/realm-js/issues/1449
🤯
This issue, though transient has never been definitively explained or solved by Realm over the past few years. There are many suggested unsustainable workarounds - i.e to clear ios/build every time someone pulls a project, and/or pod deintegrate and pod install...neither of which is working for me today.
The Watch app is irrelevant for me - I am experiencing this _without a Watch app_ on a fresh project. It seems to me there are obvious longstanding issues with the podspec/cocopods with Realm and almost every user in these threads has to find a work around.
Hi @darkheartfelt , which version of Realm you are using?
Our current release 10.1.4 is working fine with SPM.
Most helpful comment
I am seeing the same issue.
STR:
'realm/util/assert.hpp' file not foundIt builds fine for iOS, tvOS, or macOS apps, but if I add the libs to the watch target, the error occurs. If the error doesn't show, doing a clean build causes the error to show again.