9

I have an iOS-app written in obj-C and UI-tests for the app in Swift. I recently installed Xcode 9 beta 2 and wanted to compile the app. I get the following error:

"Dependency Analysis Error > 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."

Screenshot added

When I go to build settings there isn't any possibility to set a version for Swift language. Does this represent a bug? Furthermore the app itself doesn't use Swift, only the automated UI_tests.

Jayprakash Dubey
  • 35,723
  • 18
  • 170
  • 177
renraku
  • 851
  • 1
  • 9
  • 16
  • Double check the Code Generation option of Core Data Model, if the new Model has been created. – wulie Jul 27 '17 at 04:16

2 Answers2

4

It tells that you need to specify the swift version in Build Settings. Just click project and go to Build settings (not the target) and set "Swift Language Version" to Swift 3.2 or Swift 4. Here you have an screenshot :)

enter image description here

Norolim
  • 926
  • 2
  • 10
  • 25
  • thanks for responding, but the UI-test target is actually the only one where I can set the swift language version. all other build setting sheets do not contain this option. although I'm not even trying to start the tests, just the app. – renraku Jul 13 '17 at 12:13
  • Then just only in the UI-Test target if you only have Swift in there. – Norolim Jul 13 '17 at 12:14
  • 1
    Tried both versions 3.2 and 4.0 but nothing changes :/ – renraku Jul 13 '17 at 12:17
  • 1
    It worked after restarting and cleaning the project, but maybe this will help someone else – renraku Aug 22 '17 at 12:37
-1

First of all I would recommend you to use stable version of Xcode since beta may contain bugs. Xcode 9.2 version is available. You can download XIP file from this link.

You can resolve this error by using below steps :

  1. Select PROJECT
  2. Select Build Settings
  3. In Swift Language Version section select Swift 3.2 or Swift 4.0 depending on your requirement.
  4. Repeat same steps for TARGETS as well
  5. Now clean the project (shortcut : cmd + shift + k)
  6. Now this should build without an error

Screenshot 1

If you still get the same error then use below steps :

  1. Quit Xcode (shortcut : cmd + Q)
  2. Open your project
  3. Clean project (shortcut : cmd + shift + k)
Jayprakash Dubey
  • 35,723
  • 18
  • 170
  • 177