Value for SWIFT_VERSION cannot be empty
Select your app target then goto build setting, search for swift
set the swift language version from the dropdown.
How to fix SWIFT_VERSION error on PhoneGap Build
I use Cordova in my Ionic project and set the swift version in the following way. I hope this helps you as well.
By default, the Swift 4 support is added but the legacy version (2.3) can still be configured as a preference, inside the project's config.xml
, within the <platform name="ios">
section:
<preference name="UseLegacySwiftLanguageVersion" value="true" />
Or it is possible to specify the version as following, inside the project's config.xml
, within the <platform name="ios">
section:
<preference name="UseSwiftLanguageVersion" value="5" />
Your plugin is using this swift dependency, you can check this link for more info: https://www.npmjs.com/package/cordova-plugin-add-swift-support
Xcode 9 Swift Language Version (SWIFT_VERSION)
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
The “Swift Language Version” (SWIFT_VERSION) build setting error with project in Objective C
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.
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.
“Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift
In the navigator selection bar, click the magnifying glass, then search for "SWIFT_VERSION
" You will find the places in the project where you can adjust the swift version accordingly.
Related Topics
Swift: Uicollectionview Selecting Cell Indexpath Issues
Error Using Associated Types and Generics
Window Visible on All Spaces (Including Other Fullscreen Apps)
How to Add Caching to Asyncimage
Do Local Notifications Need User Permission on iOS
Change Default Global Tint Color in Swift
Interactivepopgesturerecognizer Corrupts Navigation Stack on Root View Controller
Swift 2.0 Constraintswithvisualformat
How to Recognize Continuous Touch in Swift
Healthkit Error: Missing Com.Apple.Developer.Healthkit Entitlement
Scene Kit Performance with Cube Test
Why Do Servicesubscribercellularproviders Return Nil? (In iOS 12)
Swift3:How to Handle Precedencegroup Now Operator Should Be Declare with a Body