Using Spatial in macOS

When trying to import Spatial in a project targeting macOS, I see the following error message: Cannot load underlying module for 'Spatial'.

However, when I do the exact same import in an iOS project, it works fine.

In the macOS project, Xcode offers to autocomplete the word 'Spatial', so it knows about it, but I can't use it.

I've also tried adding the Spatial framework to the macOS project (note I never added anything to the iOS project where this works). When adding, there is no Spatial.Framework listed. There is libswiftSpatial.tbd, but there is no corresponding libswiftSpatial.dylib in \usr\lib\swift as the .tbd file says there should be.

I'm kind of a n00b at this, and I don't understand what incredibly obvious thing I'm missing. The docs say Spatial is OK for macOS 13.0+, I have 13.4. I'm using Xcode 14.3.1. The doc page refers to Spatial as both a Framework, and as a module, and give no help on incorporating it into an Xcode project.

Any help is appreciated, thanks. -C

  • Same behavior with SpriteKit:

    Start a new macOS project using the "Game" template. Choose Swift, and SpriteKit.Name the project, and create it.Open ViewController.swift - note import SpriteKit.

    Xcode shows the same error, "Cannot load underlying module for 'SpriteKit'.

    Build the project. Xcode says "Build Succeeded", but still displays the message in the editor window, and in the Issue navigator pane.

    This is out of the box behavior, with no changes to the Xcode project.

Add a Comment