Swift不支持SDK"iPhoneSimulator9.3.sdk"吗? [英] Swift does not support the SDK 'iPhoneSimulator9.3.sdk'?
问题描述
我刚刚安装了xcode 8.0,并将项目升级到swift3.我使用的是swift 2.2和xcode 7.3.1.
I have just installed the xcode 8.0 and upgrade my project to swift 3. I was using swift 2.2 and xcode 7.3.1.
但是出现以下错误:
Swift不支持SDK"iPhoneSimulator9.3.sdk"
Swift does not support the SDK 'iPhoneSimulator9.3.sdk'
命令 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc 失败,退出代码为1
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
推荐答案
当我同时安装Xcode 7和7.3并在自动更新后仅剩下8.0时,这发生在我身上.
This happened to me when I had simultaneously installed both Xcode 7 and 7.3 and after automatic update I was left with 8.0 only.
端子c xcodebuild -sdk -version
的输出表明存在混乱:
One indication that something got messed up was output of xcodebuild -sdk -version
in terminal:
DVTSDK: Warning: SDK path collision for path '<DVTFilePath:0x7fd810db4c50:'/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS3.0.sdk'>': SDK with name 'watchos3.0' being superceded by SDK with 'watchos3.0'.
解决方案:
- 退出Xcode
- 转到
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
- 从该目录中删除
iPhoneOS9.3.sdk
文件夹.如果仍然需要,请确保制作一个外部副本,以便以后再放回去. - 重新启动Xcode,清理并构建
- ???
- 利润
- Quit Xcode
- go to
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
- remove the
iPhoneOS9.3.sdk
folder from that directory. Be sure to make an external copy if you still need it so you can put it back later. - restart Xcode, clean, and build
- ???
- PROFIT
更新:
根据@tsafrir注释,还删除模拟器文件夹的"iPhoneOS9.3.sdk":
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
According to @tsafrir comment, delete also 'iPhoneOS9.3.sdk' for simulator folder:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
这篇关于Swift不支持SDK"iPhoneSimulator9.3.sdk"吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!