Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift."

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?

like image 323
Vatsal Manot Avatar asked Dec 15 '16 06:12

Vatsal Manot


3 Answers

Xcode 8 seems to be wrongfully displaying a nonexistent ("phantom", if you will) No. There's a trivial fix for this:

  1. Click the tiny arrow next to SWIFT_VERSION to toggle the drop-down list.
  2. Set the values for Debug and Release to Yes.
  3. Set the values for Debug and Release back to No.

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>:

enter image description here

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.

like image 61
Vatsal Manot Avatar answered Nov 09 '22 22:11

Vatsal Manot


Please select the target in pod alamofire, search 'SWIFT_VERSION', select swift3.enter image description here

like image 17
Prakash Raj Avatar answered Nov 09 '22 22:11

Prakash Raj


Xcode 8.3.2 go to :

Build Settings > Swift Compiler - Viersion > change Swift Version

....works

like image 7
Minja Avatar answered Nov 09 '22 23:11

Minja