Swift 不支持 SDK 'iPhoneSimulator9.3.sdk'? [英] Swift does not support the SDK 'iPhoneSimulator9.3.sdk'?

查看:16
本文介绍了Swift 不支持 SDK 'iPhoneSimulator9.3.sdk'?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了 xcode 8.0 并将我的项目升级到 swift 3.我使用的是 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.

在终端中输出 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'.

解决方案:

  1. 退出 Xcode
  2. 转到/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
  3. 从该目录中删除 iPhoneOS9.3.sdk 文件夹.如果您仍然需要它,请务必制作一个外部副本,以便您稍后将其放回原处.
  4. 重启 Xcode,清理并构建
  5. ???
  6. 利润
  1. Quit Xcode
  2. go to /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
  3. 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.
  4. restart Xcode, clean, and build
  5. ???
  6. PROFIT

更新:

根据@tsafir 评论,同时删除模拟器文件夹的iPhoneOS9.3.sdk":/Applications/Xcode.app/Contents/Developer/Platforms/iPhon‌ eSimulator.platform/‌ Developer/SDKs

According to @tsafrir comment, delete also 'iPhoneOS9.3.sdk' for simulator folder: /Applications/Xcode.app/Contents/Developer/Platforms/iPhon‌​eSimulator.platform/‌​Developer/SDKs

这篇关于Swift 不支持 SDK 'iPhoneSimulator9.3.sdk'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆