I created a brand new project in Xcode 11 (an iOS single-view project with SwiftUI) and enable Mac as a target device. Without doing anything else, I try to build, and I get this error:
ld: warning: directory not found for option '-L/Applications/Xcode'
ld: warning: directory not found for option '-L11.0-Beta.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/uikitformac'
ld: warning: directory not found for option '-L/Applications/Xcode'
ld: warning: directory not found for option '-L11.0-Beta.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/uikitformac'
ld: warning: Could not find or use auto-linked library 'swiftUIKit'
Undefined symbols for architecture x86_64:
"__swift_FORCE_LOAD_$_swiftUIKit", referenced from:
__swift_FORCE_LOAD_$_swiftUIKit_$_MyProject in AppDelegate.o
__swift_FORCE_LOAD_$_swiftUIKit_$_MyProject in SceneDelegate.o
__swift_FORCE_LOAD_$_swiftUIKit_$_MyProject in ContentView.o
(maybe you meant: __swift_FORCE_LOAD_$_swiftUIKit_$_MyProject)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
As hinted by the warnings saying directory not found
, it seems Xcode doesn't like having a space in its bundle's file name.
I renamed it from Xcode 11.0-Beta.2.app
to Xcode-11.0-Beta.2.app
and now it builds just fine.