Ever since I've updated to Xcode 8.2 (GM seed, from the App Store), I have been stuck at the following error:
Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
So I went to my target's Build Settings, and searched for SWIFT_VERSION
to see where I was erring. However, I was surprised to find that it was already set to No
!
How do I fix this?
The phantom No answer will work. The real reason XCode is broken is because Apples XCode "use legacy setting" is really a Swift Version number. In XCode 8.1 'No' translated to 3.0.1, in XCode 8.2 'No' translates to 3.0. So you need to switch the version to Swift 3.0 . Which makes sense. Was a bug in XCode 8.1 I guess.
My git diff:
I see a comment above that has the same answer just think it needs to stand out more.
Xcode 8 seems to be wrongfully displaying a nonexistent ("phantom", if you will)
No
. There's a trivial fix for this:SWIFT_VERSION
to toggle the drop-down list.Debug
andRelease
toYes
.Debug
andRelease
back toNo
.The image below was taken just after setting
Debug
toNo
. Xcode shows that bothDebug
andRelease
are set toNo
, howeverSWIFT_VERSION
reads<Multiple Values>
:From this, I can only conclude that it is a bug; and that some value (or more probably a null value) is being misrepresented as
No
.Please select the target in pod alamofire, search 'SWIFT_VERSION', select swift3.
I've had the same problem about "Use Legacy Swift Language Version..", my have solved it by setting the version, The tips to resolve the problem are:
If your target already added CocoaPods, please add that code in the end of your podFile:
post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '3.0' end end end
after add that code, please update cocoaPods.
-----If you not add cocoaPods ,you can set the targets’ version be YES(TARGETS->Build Setting-->Use Legacy Swift Language Version-->YES) Hope that can help you.
I had a same problem in yesterday. Fix step:
Build settings -> search swift, choice use legacy swift language version
Toggled no to yes -> build. You will get more error.
Back toggled yes to no. build -> success!
Sometime apple make us to be come so crazy :)
All done.
Xcode 8.3.2 go to :
Build Settings > Swift Compiler - Viersion > change Swift Version
....works