Swift 不支持 SDK 'iPhoneSimulator8.4.sdk' [英] Swift does not support the SDK 'iPhoneSimulator8.4.sdk'

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

问题描述

刚刚更新到 Xcode 7.0.1,在 El Capitan (GM) 上运行,禁用 SIP.现在每次我尝试编译 Swift 项目时都会出现此错误;

Just updated to Xcode 7.0.1, running on El Capitan (GM) with SIP disabled. And now every time I try to compile a Swift project I get this error;

<unknown>:0: error: Swift does not support the SDK 'iPhoneSimulator8.4.sdk'
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

我也尝试为实际设备编译并得到:

I've tried compiling for actual devices as well and get:

<unknown>:0: error: Swift does not support the SDK 'iPhoneOS8.4.sdk'
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

我的部署目标最初设置为 8.0,我尝试将其设置为 9.0,但这没有区别.我的基础 SDK 设置为最新的 iOS(iOS 9.0).

My deployment target was originally set to 8.0, I've tried setting it to 9.0 but that makes no difference. My Base SDK is set to Latest iOS(iOS 9.0).

这是我所有的 Swift 项目,即使我创建了一个新项目,我仍然收到这个错误.

This is across all my Swift projects, even when I create a new project, I still get this error.

它似乎没有影响 Objective-C.我有一个想法,这可能是 SIP 被禁用的问题吗?它看起来不像是权限错误,但我看不出其他原因导致它不起作用.

It doesn't seem to be affecting Objective-C. One thought I've had, is could this be an issue with SIP being disabled? It doesn't look like a permissions error but I can see no other reason why this isn't working.

推荐答案

当我同时安装 Xcode 76.4 并且自动更新后我发生这种情况只剩下 7.0.1.

This happened to me when I had simultaneously installed both Xcode 7 and 6.4 and after automatic update I was left with 7.0.1 only.

xcodebuild -sdk -version 的输出:

xcodebuild[29131:8243992] [MT] DVTSDK: Warning: SDK path collision for path '<DVTFilePath:0x7fac2ae3c800:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk'>': SDK with name 'iphoneos9.0' being superceded by SDK with 'iphoneos9.0'.
...
iPhoneOS8.4.sdk - iOS 9.0 (iphoneos9.0)
SDKVersion: 9.0
Path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk
PlatformVersion: 9.0
PlatformPath: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
ProductBuildVersion: 13A340
ProductCopyright: 1983-2015 Apple Inc.
ProductName: iPhone OS
ProductVersion: 9.0
...

可能有更简单的方法来解决这个问题,但重新安装 Xcode 7.0.1 为我修复了它.

There might be easier way to solve this, but reinstalling Xcode 7.0.1 fixed it for me.

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

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