“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift."
Solution 1
Xcode 8 seems to be wrongfully displaying a nonexistent ("phantom", if you will) No
. There's a trivial fix for this:
- Click the tiny arrow next to
SWIFT_VERSION
to toggle the drop-down list. - Set the values for
Debug
andRelease
toYes
. - Set the values for
Debug
andRelease
back toNo
.
The image below was taken just after setting Debug
to No
. Xcode shows that both Debug
and Release
are set to No
, however SWIFT_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
.
Solution 2
Please select the target in pod alamofire, search 'SWIFT_VERSION', select swift3.
Solution 3
Xcode 8.3.2 go to :
Build Settings > Swift Compiler - Viersion > change Swift Version
....works
Solution 4
Just in case anyone else runs into the same issue I just had.
I had an app that was ready to launch onto the app store but i was waiting, meanwhile i updated to Xcode 9 beta and was messing around, changed a few things in my app. I went to upload it to the app store and it said you could not use beta versions to upload so i went back to Xcode 8 but it started giving me the “Swift Language Version” (SWIFT_VERSION)..." error.
My fix
Under your project Build Settings > Swift Compiler Version > I had to change this from Swift 4(currently not supported)
to Swift 3
.
Problem Solved :)
Solution 5
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:
--- a/ios/myapp.xcodeproj/project.pbxproj
+++ b/ios/myapp.xcodeproj/project.pbxproj
@@ -1757,7 +1757,7 @@
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- SWIFT_VERSION = 3.0.1;
+ SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
I see a comment above that has the same answer just think it needs to stand out more.
Vatsal Manot
Updated on July 14, 2022Comments
-
Vatsal Manot almost 2 years
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 toNo
!How do I fix this?