realm-swift: SPM : 'realm/util/assert.hpp' file not found When building project

It’s now impossible to build RealmSwift embedded via Swift Package Manager. Xcode produce an error

Goals

Build my app which embed Realm as a Swift Package.

Expected Results

Successful build

Actual Results

Capture d’écran 2019-10-19 à 10 14 21

Capture d’écran 2019-10-19 à 10 14 53

Steps to Reproduce

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”.

Version of Realm and Tooling

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

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 15 (5 by maintainers)

Most upvoted comments

I am seeing the same issue. STR:

  1. New project.
  2. Add watch target.
  3. Add Realm as a package dependency.
  4. Add Realm and RealmSwift libs to iOS and watch extension targets.
  5. Build iOS scheme. Fails with error 'realm/util/assert.hpp' file not found

It 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.

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…

Having the same issue.

I’m getting this error too. I’ll have to switch to Carthage until this is fixed.

Hi @darkheartfelt , which version of Realm you are using? Our current release 10.1.4 is working fine with SPM.

➤ Lee Maguire commented:

Hi,

I cannot reproduce this issue with the latest version (Realm 4.3.2, RealmCore 5.23.8)

Thanks