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

查看:112
本文介绍了Swift不支持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'.

解决方案:

  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

更新:

根据@tsafrir注释,还删除模拟器文件夹的"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天全站免登陆