Scanner not found in Foundation

I have a Swift package that I created in Xcode 11.

I wrote a unit test that tests a piece of coding using Scanner (NSScanner in Objective-C).

The tests pass fine when run in Xcode, but running the same tests using swift test produces the following output:


dyld: lazy symbol binding failed: Symbol not found: _$sSo9NSScannerC10FoundationE10scanStringySSSgSSF

Referenced from: <path/to/test/target> (which was built for Mac OS X 10.15)

Expected in: /usr/lib/swift/libswiftFoundation.dylib


What am I doing wrong?

Replies

This turned out to be due to libSwiftFoundation.dylib being behind the Foundation included in the iOS 13 SDK.