13

I'm using Swift 2.3 in my project. Yesterday, I updated Xcode to version 8.3 but my project can't build successfully any more. I got this error message.

“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.

Please help me! Thanks!

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Lumialxk
  • 6,239
  • 6
  • 24
  • 47
  • You need to update your Swift 2.3 code to Swift 3. Once that is done that will be the last time you are *mandated* to update your Swift code. Starting with Swift 4 that will be released later this summer, you will be able to set the compiler to use either Swift 3 **OR** Swift 4. – Brandon A Mar 30 '17 at 02:06
  • @Lumialxk Keep in mind that it is in your best interest to update to Swift 3 sooner than later. It won't be much longer before Apple won't even accept Swift 2 apps into the App Store. The longer you wait the harder it will be to get up-to-date. – rmaddy Mar 30 '17 at 03:05
  • @rmaddy Thanks for your advice! I'm wondering if Swift 4 will differ a lot from Swift 3. If yes, I want to update when Swift 4 release. – Lumialxk Mar 30 '17 at 03:12
  • You can copy the iOS 10.3 SDK into XCode 8.2 You need DeveloperDiskImage for iOS version 10.3 to run your project on device(iOS 10.3) using xcode 8.2. Rename your 8.2 version of XCode.app to XCode_8.2.app, then download the newsest XCode. You will then have two versions of XCode. In NEW Xcode, copy all the folders in: Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/ and paste it into Applications/Xcode-2.3.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/ path in your existing Xcode 8.2 in Finder. You can now run Swift 2.3 to your iOS 10.3 – Thyselius Apr 28 '17 at 09:34

2 Answers2

14

It is said in release note clearly that Xcode 8.3 doesn't support swift 2.x any more. You can either choose to use wizard to update your code to swift 3.1, or go back to Xcode 8.2.1.

https://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Chapters/Introduction.html

Owen Zhao
  • 3,205
  • 1
  • 26
  • 43
  • 10
    I prefer no use swift any more, because of Swift 3 compiler in XCode 8.3 failures with segmentation faults on generic class extensions. XCode 8.2.1 doesn't support IOS 10.3 devices. So for me Apple Swift Shot himself in the head. Good bye Swift, Hello Objective-C – poGUIst Mar 30 '17 at 16:53
  • 3
    You will be back. Swift 4 will be released in 6 month. – Owen Zhao Mar 30 '17 at 16:57
  • Here to download the Xcode 8.2.1 http://stackoverflow.com/a/10335943/5790492 – Nike Kov Apr 01 '17 at 09:16
  • 1
    update: Xcode9 too does not support previous swift versions – GvSharma Sep 22 '17 at 05:40
1

That's true. You have to convert your code to Swift 3. Or try to download a lower version of Xcode.

tuledev
  • 10,177
  • 4
  • 29
  • 49