xcode Swift 不支持 SDK 'iPhoneSimulator9.3.sdk'?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39635735/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:19:29  来源:igfitidea点击:

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

iosxcodeswift3ios-simulatorxcode8

提问by Mohsin Qureshi

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.

我刚刚安装了 xcode 8.0 并将我的项目升级到 swift 3。我使用的是 swift 2.2 和 xcode 7.3.1。

But getting following error:

但收到以下错误:

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

Swift 不支持 SDK 'iPhoneSimulator9.3.sdk'

命令 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc 失败,退出代码为 1

回答by Neil Galiaskarov

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.

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

One indication that something got messed up was output of xcodebuild -sdk -versionin terminal:

出现问题的一个迹象是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'.

Solution:

解决方案:

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

UPDATE:

更新:

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

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

回答by Bharath

The iPhoneOS9.3.sdkfor the simulator is at Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs.

iPhoneOS9.3.sdk为模拟器是Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs

  1. quit xcode
  2. delete
  3. clean
  4. build again.
  1. 退出 xcode
  2. 删除
  3. 干净的
  4. 再建。

回答by Thomas Gamble

Not the best solution, but selecting - "Use Legacy Compiler Version": Yes, removed that warning for me.

不是最好的解决方案,而是选择 - “使用旧版编译器版本”:是的,为我删除了该警告。

回答by Abo3atef

Open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs

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

回答by tikamchandrakar

It happen due to old xcode still in system and you updated new one. For fixing this use following step.

这是由于旧的 xcode 仍在系统中而您更新了新的。为了解决这个问题,请使用以下步骤。

  1. Quit Xcode
  2. go to Simulator and iPhoneOS. platform
  1. 退出 Xcode
  2. 转到模拟器和 iPhoneOS。平台

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ 3. remove the iPhoneOS9.x.sdk folder from that directory. Be sure to
make an external copy if you still need it so you can put it back
later.

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

  1. Copy old xcode sdk (iPhoneOS9.x(Updated SDK)) Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ iPhoneOS9.3(Updated SDK)
  1. 复制旧的 xcode sdk (iPhoneOS9.x(Updated SDK)) Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ iPhoneOS9.3(Updated SDK)

5> Paste this SDK in new XCODE 8 in this folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

5> 将此 SDK 粘贴到此文件夹中的新 XCODE 8 中 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

6> Clean and Build.

6> 清理和构建。

Fixed

固定的