2016-09-22 80 views
7

我刚刚安装了xcode 8.0并将我的项目升级到了swift 3.我使用的是swift 2.2和xcode 7.3.1。Swift不支持SDK'iPhoneSimulator9.3.sdk'?

但是,得到以下错误:

Swift does not support the SDK 'iPhoneSimulator9.3.sdk'

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

+0

请提供完整的生成日志。你如何参考9.3 SDK? Xcode 8自带10.0 SDK。 –

回答

1

不是最好的解决办法,但选择 - “使用传统的编译器版本”:是的,删除了警告我。

+0

我已经试过这个,但没有为我工作。 :( –

13

这发生在我身上的时候,我同时安装了Xcode 7和7.3,并且在自动更新之后,我只剩下8.0。

一个迹象表明,事情弄乱是终端的xcodebuild -sdk -version输出:

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. 利润

UPDATE:

据@tsafrir评论,删除也是 'iPhoneOS9.3.sdk' 的模拟器文件夹: /Applications/Xcode.app/Contents/Developer/Platforms/iPhon‌​eSimulator.platform/‌​Developer/SDKs

+0

除了删除'iPhoneOS9.3.sdk'的软链接,还有一个模拟器位于'/ Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs' – tsafrir

6

iPhoneOS9.3.sdk的模拟器是在​​。

  1. 退出Xcode中
  2. 再次删除
  3. 干净
  4. 构建。
0

打开/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs

0

它发生是由于旧的xcode仍处于系统和你更新后的新一个。 用于修复此使用以下步骤。

  1. 退出Xcode中
  2. 去 模拟器和的iPhoneOS。平台

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ 3.从目录中删除iPhoneOS9.x.sdk文件夹。如果您仍然需要,请务必
制作一个外部副本,以便稍后您可以将其放回

  • 复制老的xcode SDK(iPhoneOS9.x(更新SDK)) 应用/ Xcode.app /内容/开发商/平台/ iPhoneOS.platform /开发商/软件开发工具包/ iPhoneOS9.3 (更新SDK)此文件夹中
  • 5>粘贴这个SDK在新XCODE 8 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

    6>清洁和构建。

    固定