Swift编译错误:";无法为';加载基础模块;CoreGraphics&x27&引用;与“进口基金会”`

Swift编译错误:";无法为';加载基础模块;CoreGraphics&x27&引用;与“进口基金会”`,swift,macos,compiler-errors,foundation,swift3,Swift,Macos,Compiler Errors,Foundation,Swift3,使用SwiftDEVELOPMENT-SNAPSHOT-2016-02-08-a,我试图使用Swift build构建一个项目,但一旦添加行import Foundation,我就会得到错误: [I] ~/Dropbox/Projects/test ↪ swift build --clean; and swift build Compiling Swift Module 'test' (1

使用Swift
DEVELOPMENT-SNAPSHOT-2016-02-08-a
,我试图使用
Swift build
构建一个项目,但一旦添加行
import Foundation
,我就会得到错误:

[I] ~/Dropbox/Projects/test                                                     
↪ swift build --clean; and swift build
Compiling Swift Module 'test' (1 sources)
<unknown>:0: error: cannot load underlying module for 'CoreGraphics'
<unknown>:0: note: did you forget to set an SDK using -sdk or SDKROOT?
<unknown>:0: note: use "xcrun -sdk macosx swiftc" to select the default OS X SDK installed with Xcode
<unknown>:0: error: build had 1 command failures
error: exit(1): ["/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a.xctoolchain/usr/bin/swift-build-tool", "-f", "/Users/me/Dropbox/Projects/test/.build/debug/test.o/llbuild.yaml"]
这仅适用于main.swift,其内容包括:

import Foundation

print("Hello, world!")
Packages.swift中未定义依赖项

我真的不知道这里发生了什么。这在我的Ubuntu14.04 DigitalOcean VPS以及Xcode 7.3 Beta 5中编译得很好

OS X 10.11.3

↪ swift --version                                                     0@10:21:16
Apple Swift version 3.0-dev (LLVM a7663bb722, Clang 4ca3c7fa28, Swift 1c2f40e246)
Target: x86_64-apple-macosx10.9

您的[/Applications]目录中是否有稳定版本的Xcode.app?如果您只有Xcode-beta.app,那么很可能就是这个错误的原因。尝试创建Xcode-beta.app到Xcode.app的符号链接:

$ ln -s /Applications/Xcode-beta.app /Applications/Xcode.app

(很荣幸)。

不,我在Xcode-beta.app运行后删除了Xcode.app。这对我有用!非常感谢。
$ ln -s /Applications/Xcode-beta.app /Applications/Xcode.app