Xcode 8.2, Swift Compiler Error: Error: unexpected input file

After upgrading from Xcode 8.1 to 8.2, I encountered a Swift Compiler error in my project. I use the latest version of Swift and Carthage for dependency management. It did a great job with Xcode 8.1, and now I tried a few hours to fix it, clearing the DerivedData and Simulator data, clearing Xcode and deleting the Build folder, but nothing helps. I have only one version of Xcode.

I get the following compilation error:

 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 

The folder referenced is as follows:

folder that cannot be found

Actually this is so, so I don’t know what is happening ... Help is greatly appreciated! :)

+6
source share
2 answers

I had the same problem and the comments helped me sort out my problem.

In fact, this error occurs when there is a typo or an error with the option "Another quick flag". In my case, this option was empty, my CI engine threw an error in the generated command line, leading to an error:

 "error: unexpected input file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk" 

The answer to the question instead of comments can help people directly :)

+7
source

In my case, it was just because I had a file named .Swift (mind the capital S !). I correctly renamed it to .Swift and everything went fine.

+2
source

Source: https://habr.com/ru/post/1013219/


All Articles