Xcode 9 Swift Language Version (SWIFT_VERSION)
xcode 10.3 swift version
swift_version '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2. (in target 'swiftyjson')
unable to determine swift version for the following pods
change swift tools version
swift version file
how to run swift 3 in xcode 11
does not specify a swift version and none of the targets
I've recently updated xcode to version 9. Before that in Xcode 8.x whenever I use to do
pod update it shows me an update code to convert the code to Swift 3 and doing that solve the errors. But now it is giving me this 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.
For this error I've tried
Build Settings > Swift Language Version and it was Swift 3.2
But as the update call has re-installed some of the pods like Alamofire and it says to install Xcode 8.x to convert the code to Swift 3 so do I need to install an additional version with the latest Xcode? If yes, then how can I install Xcode 8 with Xcode 9?
Answer to your question:
You can download Xcode 8.x from Apple Download Portal or Download Xcode 8.3.3 (or see: Where to download older version of Xcode), if you've premium developer account (apple id). You can install & work with both Xcode 9 and Xcode 8.x in single (mac) system. (Make sure you've
Command Line Tools supporting both version of Xcode, to work with terminal (see: How to install 'Command Line Tool'))
Hint: How to migrate your code Xcode 9 compatible Swift versions (Swift 3.2 or 4)
Xcode 9 allows conversion/migration from
Swift 3.0 to
Swift 3.2/4.0 only. So if current version of Swift language of your project is below 3.0 then you must migrate your code in Swift 3 compatible version Using Xcode 8.x.
This is common error message that Xcode 9 shows if it identifies Swift language below 3.0, during migration.
Swift 3.2 is supported by Xcode 9 & Xcode 8 both.
Project ► (Select Your Project Target) ► Build Settings ► (Type 'swift' in Searchbar) Swift Compiler Language ► Swift Language Version ► Click on Language list to open it.
Convert your source code from Swift 2.0 to 3.2 using Xcode 8 and then continue with Xcode 9 (Swift 3.2 or 4).
For easier migration of your code, follow these steps: (it will help you to convert into latest version of swift supported by your Xcode Tool)
Xcode: Menus: Edit ▶ Covert ▶ To Current Swift Syntax
Swift Language Version (SWIFT_VERSION) build setting , Swift Language Version (SWIFT_VERSION) build setting Dependency Error Xcode 9 #722. Closed. mteece opened this issue on Oct 12, 2017 · 4 comments. The new release of Xcode always has a latest stable version of Swift e.g Xcode 9.3 shipped with Swift 4.1. We can always find the version of Swift with Xcode in the release notes .
For Objective C Projects created using Xcode 8 and now opening in Xcode 9, it is showing the same error as mentioned in the question.
To fix that, Press the + button in Build Settings and select Add User-Defined Setting as shown in the image below
Then in the new row created add
SWIFT_VERSION as key and
3.2 as value like below.
It will fix the error for objective c projects.
Xcode 9 Swift Language Version (SWIFT_VERSION), xcode 10 change swift version the swift language version (swift_version) build setting must be set to a supported value xcode swift language version Set your command-line tools to xcode 9.2 (9C40b). It will switch to Xcode default swift version. sudo xcode-select --switch /Applications/Xcode.app Test your swift version. swift --version Result is: Apple Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2) In conclusion, it's really an Apple documentation issue: Swift 4.1 is only
I just got this after creating a new Objective-C project in Xcode 10, after I added a Core Data model file to the project.
I found two ways to fix this:
- The Easy Way: Open the Core Data model's File Inspector (⌥⌘-1) and change the language from Swift to Objective-C
- Longer and more dangerous method
The model contains a "contents" file with this line:
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="14460.32" systemVersion="17G5019" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
In there is a
sourceLanguage="Swift" entry. Change it to
sourceLanguage="Objective-C" and the error goes away.
To find the "contents" file, right click on the
.xcdatamodeld in Xcode and do "Show in Finder". Right-click on the actual (Finder) file and do "Show Package Contents"
Also: Changing the model's language will stop Xcode from generating managed object subclass files in Swift.
Switching Swift Versions inside Xcode using Toolchains, that you have installed (unless you have changed it). When running a pod install and then opening the workspace in Xcode 9.0 (9A235) yields a Dependency Error on compilation resulting in a build failure. 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.
This can happen when you added Core Data to an existing project. Check the: <Name>/<Name>.xcdatamodeld/<Name>.xcdatamodel/contents file. This file contains an entry "sourceLanguage" that (by default) might have been set to "Swift". Change it to "Objective-C".
How do I see which version of Swift I'm using?, ( . xctoolchain ) includes a copy of the compiler, lldb, and other related tools needed to provide a cohesive development experience for working in a specific version of Swift.” Xcode 9 version linguistique Swift (version SWIFT)) j'ai récemment mis à jour xcode à la version 9. Avant ça dans Xcode 8.x chaque fois que j'utilise pour faire pod update il me montre un code de mise à jour pour convertir le code à Swift 3 et ce faisant résoudre les erreurs.
I just click on latest swift convert button and set App target build setting-> Swift language version: swift 4.0,
Hope this will help.
How To Update Swift Code from XCode., ℹ After upgrading to XCode 9, building throws the error: `The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a $ xcrun swift -version Output for Xcode 6.3.2 is: Apple Swift version 1.2 (swiftlang-602.0.53.1 clang-602.0.53) Of course that assumes that your xcrun is pointing at your copy of Xcode correctly. If, like me, you're juggling several versions of Xcode, that can be a worry! To make sure that it is, say $ xcrun --find swift
Installing Swift 5 toolchain in Xcode - Rizwan Ahmed, Jens (Jens Persson) December 9, 2018, 3:13pm #1 error: SWIFT_VERSION '5' is unsupported, supported versions are: 3.0, 4.0, 4.2. (if 4.2 is what the Swift Language Version of my target is set to, leaving it unspecified is Version Compatibility¶. This book describes Swift 5.1, the default version of Swift that’s included in Xcode 11. You can use Xcode 11 to build targets that are written in either Swift 5.1, Swift 4.2, or Swift 4. When you use Xcode 11 to build Swift 4 and Swift 4.2 code, most Swift 5.1 functionality is available.
Upgrade to XCode 9 causes Swift version error – Airship Support, I've recently updated xcode to version 9. Before that in Xcode 8.x whenever I use to do pod update it shows me an update code to convert the code to Swift 3 and 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.
How to set Swift version 5 (for recent dev snapshots) in Xcode build , I get the error Swift Language Version (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Xcode 9 Swift Versión de Idioma (SWIFT_VERSION) Recientemente he xcode actualizado a la versión 9. Antes de que en Xcode 8.x siempre que uso para hacer pod update me muestra un código de actualización para convertir el código Swift 3 y haciendo que resolver los errores.
- try cleaning the Derived Data and build the project on Xcode 9.
- Whats your swift version in Xcode 8??
- it was 8.3.3 I think. it was the latest one before xcode 9.
- If you've come here because you're only now (Dec 2018) dusting off some Swift 2 code, you'll be disappointed to learn that Xcode 8 does not run on Mojave.
- This helped me. Thanks.
- If you're having this issue with CocoaPods, you might need to add this build setting to the pods.xcodeproject section.
- This worked . . Thanks bro @R.Mohan
- This worked for me I also had to modify the 'ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES' in the build settings to '$(inherited)'
- Thank you again 2 months later
- and someone tell me what is my mistake!?
- I wouldn't personally downvote this, nothing wrong with your answer, but the best place will be to comment on the OP's question. Also you can take a look at stackoverflow.com/help/how-to-answer which will aid you in coming up with the correct way to answer questions.