There is a bug in Xcode 8.2 that – after upgrading to this version – it is no longer able to build your project. The build error message is:
Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift.
We saw this in projects where we are not using any legacy Swift, i.e. everything is Swift 3. Also there is a project-wide setting to NOT use legacy Swift. The new bug seems to ignore the project-setting.
The error looks like this:
We set up the “Use Legacy Swift Language Version” to No on project level. In the “Levels” view of the build settings you can see this to be the case.
So – technically it should work, because if a setting is not specified on the target level, then the one from project-level would be used. Or rather, was used, until Xcode 8.1. The solution is to go in and specify the setting explicitly on all targets which use Swift. You need to see the value in bold to know that it is specified.
When you make this change, Xcode add SWIFT_VERSION = 3.0; to the project file for these targets.
Until Apple fixes this incorrect interpretation of the project-wide build setting for the Swift version setting, we will have to manually specify it on target-level ourselves.
Also published on Medium.
Categories: Bug Reports