從Xcode 8.1更新到8.2後,我在我的項目中遇到了Swift Compiler Error。我正在使用最新的Swift版本和Carthage進行依賴管理。它在Xcode 8.1上工作得很好,現在我已經嘗試了幾個小時來修復它,方法是清理DerivedData
和Simulator數據,在Xcode中清理並刪除Build
文件夾,但似乎沒有任何幫助。我只安裝了一個Xcode版本。Xcode 8.2,Swift編譯器錯誤:錯誤:意外的輸入文件
我得到以下編譯錯誤:
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
cd <ProjectSource>
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk
export TOOLCHAINS=com.apple.dt.toolchain.XcodeDefault
-- all files to compile --
unknown>:0: error: unexpected input file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code
,它指的是看起來像這樣的文件夾:
它實際上是有那麼我不知道是什麼的線索繼續... 非常感謝幫助! :)
如果將設備設置爲通用iOS設備,它會生成OK嗎? –
不,這是相同的 –
我遇到了同樣的問題,這對我來說是由於搞亂了快捷旗幟造成的。我認爲它一定是在我去除可可足時才引入的,剩下一個-D。 – wayju