Xcode 9: Swift dependency analysis error

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

屏幕截图添加

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.


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

在这里输入图像描述


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 :

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

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

  • Quit Xcode (shortcut : cmd + Q )
  • Open your project
  • Clean project (shortcut : cmd + shift + k )
  • 链接地址: http://www.djcxy.com/p/39960.html

    上一篇: React Native停留在启动打包程序

    下一篇: Xcode 9:Swift依赖关系分析错误