1

I am following this tutorial and am trying to get the starter project to run. When I open the project, I see these warnings:

Unsupported Swift Version
The target “SocketChat” contains source code developed with Swift 2.x. Xcode 9 does not support building or migrating Swift 2.x targets.

Use Xcode 8.x to migrate the code to Swift 3.

On running this program stops executions and I get this error

Dependency Analysis Error Group
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.

I am using Xcode 9 beta. How can I resolve this issue and get the project running?

  • 1
    Read the error. It tells you exactly what you need to do. – rmaddy Sep 06 '17 at 16:59
  • 1
    But your best solution is to use a better, newer tutorial. Swift 2 is dead. – rmaddy Sep 06 '17 at 17:00
  • 2
    Migration is not the ideal start for a beginner therefore I would advise to start with a Swift 3 tutorial and Xcode 8. If you don't know what you are doing, don't use betas. – Sulthan Sep 06 '17 at 17:00
  • @Sulthan Good advice but if the OP waits one week, Xcode 9 won't be beta any more. – rmaddy Sep 06 '17 at 17:03
  • I would **not** recommend this for beginner, but I just called up an old Swift 2.1 project, received the same error, and couldn't get the "Edit|Convert" to work, nor the build (all as expected). But I did find that the *Swift Language Version" build setting for the target was set to *Unspecified*. After changing it to Swift 3.2, the build yield two expected warnings (update to recommended project settings and upgrade to Swift 4.0 is available) along with four build errors on syntax changes. TO REPEAT: This is not for the feint of heart nor beginners! But it might help out experienced devs –  Sep 06 '17 at 17:32
  • @rmaddy How do you know it will be one week? – matt Sep 06 '17 at 17:33
  • @matt I suppose it could be two weeks given next week's big event. – rmaddy Sep 06 '17 at 17:38
  • @rmaddy I would prefer longer, given what a train wreck iOS 11 is right now; I've got a list of bugs as long as your arm, and growing – matt Sep 06 '17 at 17:48
  • @rmaddy I have developed few apps a year ago, and took a break from developing. Now I opened updated xcode and I'm getting the same error. I understand that I need to migrate. Is it better to migrate or start from scratch with latest swift. Please help – Pruthvi Hariharan Oct 14 '17 at 13:01
  • Old version of swift is working on old version of xcode .this tutorial is running on xcode 7.3 –  Oct 16 '17 at 11:59

1 Answers1

1

Your project possibly has swift 2.0, swift 2.1 or swift 2.2 version so Xcode 9 or later does not support that versions. and neither it can convert the swift 2.x's syntax to swift 4

Remember that xcode 9 or later has swift 4 version by default.

Open this project in Xcode 8 8.1, 8.2, or 8.3 your project will run successfully.

Xcodian Solangi
  • 2,342
  • 5
  • 24
  • 52