在这里,我已经看到有关这个错误的几个(好的,不是很多,但是很少)的问题,但是没有一个提出的解决方案适用于我.这是我得到的
$swift Welcome to Apple Swift version 2.1.1 (swiftlang-700.1.101.15 clang-700.1.81). Type :help for assistance. warning: Swift error in module repl_swift: Error creating module Swift AST context: couldn't get a ClangImporter Debug info from this module will be unavailable in the debugger. warning: Swift error in module dyld: Error creating module Swift AST context: couldn't get a ClangImporter Debug info from this module will be unavailable in the debugger. warning: Swift error in module CoreFoundation: Error creating module Swift AST context: couldn't get a ClangImporter Debug info from this module will be unavailable in the debugger. ... warning: Swift error in module ServiceManagement: Error creating module Swift AST context: couldn't get a ClangImporter Debug info from this module will be unavailable in the debugger. warning: Swift error in module libxslt.1.dylib: Error creating module Swift AST context: couldn't get a ClangImporter Debug info from this module will be unavailable in the debugger. error: Error creating target Swift AST context: (null)
这可能是也可能没有发生在我发出一些我不记得的命令之后(我的黑社会历史没有太大帮助).奇怪的是,如果我卸载Xcode,REPL开始正常工作.但是,如果我重新安装Xcode,错误就会回来.我在Xcode 7.2.1(7C1002),顺便说一句.思考?
解决方法
要查看当前的Xcode路径:
xcode-select -p
我是一条老路:
/Applications/Xcode.app/Contents/Developer
然后通过以下方式更新此路径:
sudo xcode-select -s / Library / Developer / CommandLineTools