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

China☆狼群 提交于 2019-11-27 15:14:06

问题


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.

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


回答1:


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.

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'.

Solution:

  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

UPDATE:

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




回答2:


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

  1. quit xcode
  2. delete
  3. clean
  4. build again.



回答3:


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




回答4:


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

  1. Quit Xcode
  2. go to Simulator and iPhoneOS. platform

/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.

  1. Copy old 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/

6> Clean and Build.

Fixed




回答5:


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



来源:https://stackoverflow.com/questions/39635735/swift-does-not-support-the-sdk-iphonesimulator9-3-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!