Build ios (SWIFT_VERSION) is required to be configured correctly for targets which use Swift

Hi guys ! I’m having this error below when running [ ionic cordova build ios ] in the CLI

52

josnyjs$ ionic info

cli packages: (/Users/josnyjs/Documents/MobDev/MyApp/node_modules)

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

global packages:

Cordova CLI : 7.0.1 

local packages:

@ionic/app-scripts : 2.1.4
Cordova Platforms  : android 6.2.3 ios 4.4.0
Ionic Framework    : ionic-angular 3.6.0

System:

Android SDK Tools : 25.2.3
ios-sim           : 5.0.13 
Node              : v7.7.3
npm               : 4.1.2 
OS                : macOS Sierra
Xcode             : Xcode 8.3.3 Build version 8E3004b

Any idea of what is the cause of this issue please ?

I can’t read any of the text on these screenshots. Please post actual text and format it as code with the </> button above the input field. Thanks.

Here is everything from the screenshots

ionic cordova platform add ios
> cordova platform add ios --save
✖ Running command - failed!
[ERROR] Exception: Using cordova-fetch for cordova-ios@~4.4.0

        Adding ios project...
        Creating Cordova project for the iOS platform:
        	Path: platforms/ios
        	Package: com.myApp.app
        	Name: MyApp
        iOS project created with cordova-ios@4.4.0
        Installing "com.googlemaps.ios" for ios
        Installing "cordova-plugin-add-swift-support" for ios
        Installing "cordova-plugin-app-event" for ios
        Installing "cordova-plugin-camera" for ios
        Plugin dependency "cordova-plugin-compat@1.1.0" already fetched, using that version.
        Installing "cordova-plugin-compat" for ios
        Dependent plugin "cordova-plugin-compat" already installed on ios.
        Installing "cordova-plugin-console" for ios
        Installing "cordova-plugin-device" for ios
        Installing "cordova-plugin-file" for ios
        Plugin dependency "cordova-plugin-compat@1.1.0" already fetched, using that version.
        Dependent plugin "cordova-plugin-compat" already installed on ios.
        Installing "cordova-plugin-file-transfer" for ios
        Plugin dependency "cordova-plugin-file@4.3.3" already fetched, using that version.
        Dependent plugin "cordova-plugin-file" already installed on ios.
        Installing "cordova-plugin-filepath" for ios
        Installing "cordova-plugin-geofence" for ios
        Plugin dependency "cordova-plugin-add-swift-support@1.7.0" already fetched, using that version.
        Dependent plugin "cordova-plugin-add-swift-support" already installed on ios.
        Plugin dependency "cordova-plugin-compat@1.1.0" already fetched, using that version.
        Dependent plugin "cordova-plugin-compat" already installed on ios.
        Plugin dependency "es6-promise-plugin@4.1.0" already fetched, using that version.
        Installing "es6-promise-plugin" for ios
        Installing "cordova-plugin-geolocation" for ios
        Plugin dependency "cordova-plugin-compat@1.1.0" already fetched, using that version.
        Dependent plugin "cordova-plugin-compat" already installed on ios.
        Installing "cordova-plugin-googlemaps" for ios
        Plugin dependency "com.googlemaps.ios@2.3.0" already fetched, using that version.
        Dependent plugin "com.googlemaps.ios" already installed on ios.
        
                      In order to run this plugin, you need to obtain Google Maps API key for iOS.
                      Visit https://github.com/mapsplugin/cordova-plugin-googlemaps/wiki/Installation
        
                      Check our release notes.
                      https://github.com/mapsplugin/cordova-plugin-googlemaps/wiki/Release-Notes
                
        Installing "cordova-plugin-inappbrowser" for ios
        Installing "cordova-plugin-nativegeocoder" for ios
        Plugin dependency "cordova-plugin-add-swift-support@1.7.0" already fetched, using that version.
        Dependent plugin "cordova-plugin-add-swift-support" already installed on ios.
        Installing "cordova-plugin-splashscreen" for ios
        Installing "cordova-plugin-statusbar" for ios
        Installing "cordova-plugin-whitelist" for ios
        Installing "cordova-plugin-x-socialsharing" for ios
        Plugin dependency "es6-promise-plugin@4.1.0" already fetched, using that version.
        Dependent plugin "es6-promise-plugin" already installed on ios.
        Installing "de.appplant.cordova.plugin.local-notification" for ios
        Plugin dependency "cordova-plugin-device@1.1.4" already fetched, using that version.
        Dependent plugin "cordova-plugin-device" already installed on ios.
        Plugin dependency "cordova-plugin-app-event@1.2.0" already fetched, using that version.
        Dependent plugin "cordova-plugin-app-event" already installed on ios.
        Dependent plugin "es6-promise-plugin" already installed on ios.
        Installing "ionic-plugin-keyboard" for ios
        Installing "phonegap-plugin-push" for ios
        Failed to install 'phonegap-plugin-push': undefined
        Error: CocoaPods was not found. Please install version 1.0.1 or greater from https://cocoapods.org/
ionic cordova prepare ios

? Platform ios is not installed! Would you like to install it? Yes
> cordova platform add ios --save
✖ Running command - failed!
[WARN] Platform already added. Saving platforms to config.xml.
> cordova platform save
✔ Running command - done!
> cordova prepare ios
✔ Running command - done!
> cordova build ios
⠙ Running command [12:14:41]  lint finished in 6.59 s 
✖ Running command - failed!
[ERROR] An error occurred while running cordova build ios (exit code 1):

        
        (truncated) ...  -Wno-infinite-recursion -fobjc-abi-version=2 -fobjc-legacy-dispatch -iquote 
        /Users/josnyjs/Library/Developer/Xcode/DerivedData/MyApp-cbltlwqrlnejqbdyqughsctaucww/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Cordova-generated-files.hmap 
        -I/Users/josnyjs/Library/Developer/Xcode/DerivedData/MyApp-cbltlwqrlnejqbdyqughsctaucww/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Cordova-own-target-headers.hmap 
        -I/Users/josnyjs/Library/Developer/Xcode/DerivedData/MyApp-cbltlwqrlnejqbdyqughsctaucww/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Cordova-all-target-headers.hmap 
        -iquote 
        /Users/josnyjs/Library/Developer/Xcode/DerivedData/MyApp-cbltlwqrlnejqbdyqughsctaucww/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Cordova-project-headers.hmap 
        -I/Users/josnyjs/Documents/MobDev/MyApp/platforms/ios/build/emulator/include 
        -I/Users/josnyjs/Documents/MobDev/MyApp/platforms/ios/build/emulator/usr/local/lib/include 
        -I/Users/josnyjs/Library/Developer/Xcode/DerivedData/MyApp-cbltlwqrlnejqbdyqughsctaucww/Build/Intermediates/UninstalledProducts/include 
        -I/Users/josnyjs/Library/Developer/Xcode/DerivedData/MyApp-cbltlwqrlnejqbdyqughsctaucww/Build/Intermediates/UninstalledProducts/iphonesimulator/include 
        -I/Users/josnyjs/Documents/MobDev/MyApp/platforms/ios/build/emulator 
        -I/Users/josnyjs/Library/Developer/Xcode/DerivedData/MyApp-cbltlwqrlnejqbdyqughsctaucww/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/DerivedSources/x86_64 
        -I/Users/josnyjs/Library/Developer/Xcode/DerivedData/MyApp-cbltlwqrlnejqbdyqughsctaucww/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/DerivedSources 
        -F/Users/josnyjs/Documents/MobDev/MyApp/platforms/ios/build/emulator -DDEBUG -include 
        /Users/josnyjs/Documents/MobDev/MyApp/platforms/ios/build/sharedpch/CordovaLib_Prefix-cwskrwxlxponrscvxyexkycjthvj/CordovaLib_Prefix.pch 
        -MMD -MT dependencies -MF 
        /Users/josnyjs/Library/Developer/Xcode/DerivedData/MyApp-cbltlwqrlnejqbdyqughsctaucww/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Objects-normal/x86_64/CDVIntentAndNavigationFilter.d 
        --serialize-diagnostics 
        /Users/josnyjs/Library/Developer/Xcode/DerivedData/MyApp-cbltlwqrlnejqbdyqughsctaucww/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Objects-normal/x86_64/CDVIntentAndNavigationFilter.dia 
        -c 
        /Users/josnyjs/Documents/MobDev/MyApp/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m 
        -o 
        /Users/josnyjs/Library/Developer/Xcode/DerivedData/MyApp-cbltlwqrlnejqbdyqughsctaucww/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Objects-normal/x86_64/CDVIntentAndNavigationFilter.o
        
        Libtool /Users/josnyjs/Documents/MobDev/MyApp/platforms/ios/build/emulator/libCordova.a normal x86_64
             cd /Users/josnyjs/Documents/MobDev/MyApp/platforms/ios/CordovaLib
             export IPHONEOS_DEPLOYMENT_TARGET=9.0
             export 
        PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/.composer/vendor/bin:/Users/josnyjs/.composer/vendor/bin:/Users/josnyjs/Library/Android/sdk/tools:/Users/josnyjs/Library/Android/sdk/platform-tools"
             /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static 
        -arch_only x86_64 -syslibroot 
        /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk 
        -L/Users/josnyjs/Documents/MobDev/MyApp/platforms/ios/build/emulator -filelist 
        /Users/josnyjs/Library/Developer/Xcode/DerivedData/MyApp-cbltlwqrlnejqbdyqughsctaucww/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Objects-normal/x86_64/Cordova.LinkFileList 
        -o /Users/josnyjs/Documents/MobDev/MyApp/platforms/ios/build/emulator/libCordova.a
        
        === BUILD TARGET MyApp OF PROJECT MyApp WITH CONFIGURATION Debug ===
        
        Check dependencies
        “Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use 
        the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor 
        to configure the build setting directly.
        
        ** BUILD FAILED **
        
        
        The following build commands failed:
        	Check dependencies
        (1 failure)
        Error: Error code 65 for command: xcodebuild with args: 
        -xcconfig,/Users/josnyjs/Documents/MobDev/MyApp/platforms/ios/cordova/build-debug.xcconfig,-workspace,MyApp.xcworkspace,-scheme,MyApp,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS 
        Simulator,name=iPhone 
        SE,build,CONFIGURATION_BUILD_DIR=/Users/josnyjs/Documents/MobDev/MyApp/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/josnyjs/Documents/MobDev/MyApp/platforms/ios/build/sharedpch
1 Like

Did you do this? Otherwise the iOS platform installed is broken.

Didn’t notice ! This solved it ! Thanks

1 Like