_From @emcniece on September 30, 2016 23:18_
IOS builds are failing with the recent update to XCode 8 - "(SWIFT_VERSION) is required to be configured correctly..."
Successful compilations. Setting the SWIFT_VERSION=2.3 variable in the environment doesn't affect the build process.
Steps to reproduce:
ionic build iosRunning 'build:before' npm script before build
> ionic-hello-world@ build /Users/emcniece/Code/ionic/app
> ionic-app-scripts build --dev
[15:59:52] ionic-app-scripts 0.0.23
[15:59:52] build dev started ...
[15:59:52] clean started ...
[15:59:52] clean finished in 10 ms
[15:59:52] copy started ...
[15:59:52] typescript compiler started ...
[15:59:52] lint started ...
[15:59:52] copy finished in 54 ms
[15:59:52] tslint: /Users/emcniece/Code/ionic/app/src/providers/diagnostic/diagnostic.ts[4, 10]: Unused import: 'Diagnostic'
[15:59:52] lint finished in 601 ms
[15:59:54] typescript compiler finished in 2.30 s
[15:59:54] bundle dev started ...
[16:00:00] bundle dev finished in 6.41 s
[16:00:00] sass started ...
[16:00:02] sass finished in 1.23 s
[16:00:02] build dev finished in 9.95 s
Running command: /Users/emcniece/Code/ionic/app/hooks/after_prepare/010_add_platform_class.js /Users/emcniece/Code/ionic/app
add to body class: platform-ios
Building project: /Users/emcniece/Code/ionic/app/platforms/ios/MyApp.xcodeproj
Configuration: Debug
Platform: emulator
Build settings from command line:
CONFIGURATION_BUILD_DIR = /Users/emcniece/Code/ionic/app/platforms/ios/build/emulator
SDKROOT = iphonesimulator10.0
SHARED_PRECOMPS_DIR = /Users/emcniece/Code/ionic/app/platforms/ios/build/sharedpch
Build settings from configuration file '/Users/emcniece/Code/ionic/app/platforms/ios/cordova/build-debug.xcconfig':
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
CODE_SIGN_IDENTITY = iPhone Developer
ENABLE_BITCODE = NO
GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1
HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include" "$(OBJROOT)/UninstalledProducts/include" "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" "$(BUILT_PRODUCTS_DIR)"
IPHONEOS_DEPLOYMENT_TARGET = 8.0
OTHER_LDFLAGS = -ObjC
SWIFT_OBJC_BRIDGING_HEADER = $(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h
TARGETED_DEVICE_FAMILY = 1,2
=== BUILD TARGET CordovaLib OF PROJECT CordovaLib WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET MyApp OF PROJECT MyApp WITH CONFIGURATION Debug ===
Check dependencies
warning: no rule to process file '/Users/emcniece/Code/ionic/app/platforms/ios/MyApp/Plugins/cordova-plugin-is-debug/IsDebug.h' of type sourcecode.c.h for architecture i386
“Use Legacy 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/emcniece/Code/ionic/app/platforms/ios/cordova/build-debug.xcconfig,-project,MyApp.xcodeproj,-target,MyApp,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,build,CONFIGURATION_BUILD_DIR=/Users/emcniece/Code/ionic/app/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/emcniece/Code/ionic/app/platforms/ios/build/sharedpch
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
Which Ionic Version? 2.x
ionic info:
Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v6.7.0
Xcode version: Xcode 8.0 Build version 8A218a
Any way to get around this?
_Copied from original issue: driftyco/ionic#8374_
Sorry @jgw96, I don't understand why is this an Ionic Native issue?
Agreed - if anything, this is an XCode issue. I was just hoping to see if anyone else in the field was dealing with the same problem.
There are a few stack tickets around this, but nothing that solves the problem for the Ionic CLI.
Actually @ihadeed on second thought, perhaps this an Ionic Native issue. Not with Ionic Native specifically, but with the plugins and surrounding community.
Any plugin that uses Swift is going to throw this error. Here's a quick setup to test:
ionic start swift-test --v2
cd swift-test
ionic platform add ios
ionic build ios
# We have proved that IOS compiles, now to make it fail.
# This plugin is from http://ionicframework.com/docs/v2/native/geofence/
ionic plugin add cordova-plugin-geofence --save
ionic build ios
And the build fails here. Stack dump:
➜ swift-test/ ionic build ios
Running 'build:before' npm script before build
> ionic-hello-world@ build /Users/emcniece/Code/ionic/swift-test
> ionic-app-scripts build
[18:01:22] ionic-app-scripts 0.0.28
[18:01:22] build prod started ...
[18:01:22] clean started ...
[18:01:22] clean finished in 9 ms
[18:01:22] copy started ...
[18:01:22] ngc started ...
[18:01:22] lint started ...
[18:01:22] copy finished in 72 ms
[18:01:22] lint finished in 450 ms
[18:01:33] ngc finished in 10.91 s
[18:01:33] bundle prod started ...
[18:01:39] bundle prod finished in 5.95 s
[18:01:39] sass started ...
[18:01:40] sass finished in 1.14 s
[18:01:40] minify started ...
[18:01:40] cleancss started ...
[18:01:40] uglifyjs started ...
[18:01:49] uglifyjs finished in 8.76 s
[18:01:49] cleancss finished in 8.77 s
[18:01:49] minify finished in 8.77 s
[18:01:49] build prod finished in 26.78 s
Running command: /Users/emcniece/Code/ionic/swift-test/hooks/after_prepare/010_add_platform_class.js /Users/emcniece/Code/ionic/swift-test
add to body class: platform-ios
Building project : /Users/emcniece/Code/ionic/swift-test/platforms/ios/swift-test.xcodeproj
Configuration : Debug
Platform : emulator
Build settings from command line:
ARCHS = i386
CONFIGURATION_BUILD_DIR = /Users/emcniece/Code/ionic/swift-test/platforms/ios/build/emulator
SDKROOT = iphonesimulator10.0
SHARED_PRECOMPS_DIR = /Users/emcniece/Code/ionic/swift-test/platforms/ios/build/sharedpch
VALID_ARCHS = i386
Build settings from configuration file '/Users/emcniece/Code/ionic/swift-test/platforms/ios/cordova/build-debug.xcconfig':
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
CODE_SIGN_IDENTITY = iPhone Developer
ENABLE_BITCODE = NO
GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1
HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include" "$(OBJROOT)/UninstalledProducts/include" "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" "$(BUILT_PRODUCTS_DIR)"
IPHONEOS_DEPLOYMENT_TARGET = 8.0
OTHER_LDFLAGS = -ObjC
SWIFT_OBJC_BRIDGING_HEADER = $(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h
TARGETED_DEVICE_FAMILY = 1,2
=== BUILD TARGET CordovaLib OF PROJECT CordovaLib WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET swift-test OF PROJECT swift-test WITH CONFIGURATION Debug ===
Check dependencies
“Use Legacy 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/emcniece/Code/ionic/swift-test/platforms/ios/cordova/build-debug.xcconfig,-project,swift-test.xcodeproj,ARCHS=i386,-target,swift-test,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/emcniece/Code/ionic/swift-test/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/emcniece/Code/ionic/swift-test/platforms/ios/build/sharedpch
To rehash, the real problem here is XCode 8 complaining about SWIFT_VERSION settings, but this problem definitely does affect the Ionic Native platform much more than Ionic as a whole.
Am I mistaken in thinking that all of these plugins are going to need to be converted for Swift 2.3 compatibility?
After reading https://github.com/Carthage/Carthage/pull/1442/commits/89b2725c4f19ea4ac4bdc5a63048af1475b740a1?diff=split, one of the steps to push XCode in the right direction is to include a SWIFT_VERSION = 2.3; line in the buildSettings block for each plugin in the project.pbxproj file. Once this is done, XCode stops complaining about the version.
In this example (with Geofence), adding this property is all that is needed to get the build to compile and emulate. I haven't tested the actual functionality, but I assume that the plugin would work.
Here is what an upgraded project.pbxproj file looks like: (4 occurrences of SWIFT_VERSION)
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
0207DA581B56EA530066E2B4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0207DA571B56EA530066E2B4 /* Images.xcassets */; };
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
301BF552109A68D80062928A /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 301BF535109A57CC0062928A /* libCordova.a */; };
302D95F114D2391D003F00A1 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 302D95EF14D2391D003F00A1 /* MainViewController.m */; };
302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 302D95F014D2391D003F00A1 /* MainViewController.xib */; };
3047A5121AB8059700498E2A /* build-debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 3047A50F1AB8059700498E2A /* build-debug.xcconfig */; };
3047A5131AB8059700498E2A /* build-release.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 3047A5101AB8059700498E2A /* build-release.xcconfig */; };
3047A5141AB8059700498E2A /* build.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 3047A5111AB8059700498E2A /* build.xcconfig */; };
14747B47F6EF4384B3D76B11 /* CDVLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = E3F8D41EE3554DC3BBB512B7 /* CDVLogger.m */; };
FBD5A33841474247A1EFA3F2 /* CDVDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = ADCBB40757A24067AF77D95F /* CDVDevice.m */; };
0EB9E8FCB5414DC183FE81C1 /* CDVSplashScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F21B1DA0CF44CD29C59A070 /* CDVSplashScreen.m */; };
3326E29675484E738CF20B86 /* CDVViewController+SplashScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = E50FCF3F6C5B4E2CB058DA9A /* CDVViewController+SplashScreen.m */; };
435307A1A8B64099898B261B /* CDVStatusBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 28FDE6B02758455C87F7384C /* CDVStatusBar.m */; };
FB9D21F873E74009B4FF3B93 /* IonicKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BF59A8AD2D14CAE8022A276 /* IonicKeyboard.m */; };
2A514E297F744057B7D8E1E3 /* GeofencePlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = C30458F25F294C17B7D9B03A /* GeofencePlugin.swift */; };
62D789781CD2489FA3490006 /* SwiftData.swift in Sources */ = {isa = PBXBuildFile; fileRef = A30AA6EAA92B40E48EC70E02 /* SwiftData.swift */; };
0B274BD7666744ADBD31319A /* SwiftyJson.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E4C96B470E64453A6719122 /* SwiftyJson.swift */; };
2B31C62D126249EF8E3EC749 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CB7C6AB6F42484E9E0A0D32 /* libsqlite3.dylib */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
301BF534109A57CC0062928A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = D2AAC07E0554694100DB518D;
remoteInfo = CordovaLib;
};
301BF550109A68C00062928A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = D2AAC07D0554694100DB518D;
remoteInfo = CordovaLib;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
0207DA571B56EA530066E2B4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "swift-test/Images.xcassets"; sourceTree = SOURCE_ROOT; };
1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
1D6058910D05DD3D006BFB54 /* swift-test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "swift-test.app"; sourceTree = BUILT_PRODUCTS_DIR; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CordovaLib.xcodeproj; path = CordovaLib/CordovaLib.xcodeproj; sourceTree = "<group>"; };
301BF56E109A69640062928A /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = SOURCE_ROOT; };
302D95EE14D2391D003F00A1 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
302D95EF14D2391D003F00A1 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; };
302D95F014D2391D003F00A1 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = "<group>"; };
3047A50F1AB8059700498E2A /* build-debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-debug.xcconfig"; path = cordova/build-debug.xcconfig; sourceTree = SOURCE_ROOT; };
3047A5101AB8059700498E2A /* build-release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-release.xcconfig"; path = cordova/build-release.xcconfig; sourceTree = SOURCE_ROOT; };
3047A5111AB8059700498E2A /* build.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = build.xcconfig; path = cordova/build.xcconfig; sourceTree = SOURCE_ROOT; };
32CA4F630368D1EE00C91783 /* swift-test-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "swift-test-Prefix.pch"; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* swift-test-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "swift-test-Info.plist"; path = "swift-test/swift-test-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = SOURCE_ROOT; };
EB87FDF31871DA8E0020F90C /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = "<group>"; };
EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = "<group>"; };
F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = "swift-test/config.xml"; sourceTree = "<group>"; };
ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Bridging-Header.h"; path = "Bridging-Header.h"; sourceTree = "<group>"; };
E3F8D41EE3554DC3BBB512B7 /* CDVLogger.m */ = {isa = PBXFileReference; name = "CDVLogger.m"; path = "cordova-plugin-console/CDVLogger.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
D2DA96555B65426F9B7A6BDD /* CDVLogger.h */ = {isa = PBXFileReference; name = "CDVLogger.h"; path = "cordova-plugin-console/CDVLogger.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
ADCBB40757A24067AF77D95F /* CDVDevice.m */ = {isa = PBXFileReference; name = "CDVDevice.m"; path = "cordova-plugin-device/CDVDevice.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
310BBF5A06F8488CB7721030 /* CDVDevice.h */ = {isa = PBXFileReference; name = "CDVDevice.h"; path = "cordova-plugin-device/CDVDevice.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
4F21B1DA0CF44CD29C59A070 /* CDVSplashScreen.m */ = {isa = PBXFileReference; name = "CDVSplashScreen.m"; path = "cordova-plugin-splashscreen/CDVSplashScreen.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
E50FCF3F6C5B4E2CB058DA9A /* CDVViewController+SplashScreen.m */ = {isa = PBXFileReference; name = "CDVViewController+SplashScreen.m"; path = "cordova-plugin-splashscreen/CDVViewController+SplashScreen.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
E485D177C010453B97647205 /* CDVSplashScreen.h */ = {isa = PBXFileReference; name = "CDVSplashScreen.h"; path = "cordova-plugin-splashscreen/CDVSplashScreen.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
E4C6D0F8FA454923BC1DD02A /* CDVViewController+SplashScreen.h */ = {isa = PBXFileReference; name = "CDVViewController+SplashScreen.h"; path = "cordova-plugin-splashscreen/CDVViewController+SplashScreen.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
28FDE6B02758455C87F7384C /* CDVStatusBar.m */ = {isa = PBXFileReference; name = "CDVStatusBar.m"; path = "cordova-plugin-statusbar/CDVStatusBar.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
4431D3A441D344A18FE35B8F /* CDVStatusBar.h */ = {isa = PBXFileReference; name = "CDVStatusBar.h"; path = "cordova-plugin-statusbar/CDVStatusBar.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
7BF59A8AD2D14CAE8022A276 /* IonicKeyboard.m */ = {isa = PBXFileReference; name = "IonicKeyboard.m"; path = "ionic-plugin-keyboard/IonicKeyboard.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
A8999E4035094CA7A2641003 /* IonicKeyboard.h */ = {isa = PBXFileReference; name = "IonicKeyboard.h"; path = "ionic-plugin-keyboard/IonicKeyboard.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
C30458F25F294C17B7D9B03A /* GeofencePlugin.swift */ = {isa = PBXFileReference; name = "GeofencePlugin.swift"; path = "cordova-plugin-geofence/GeofencePlugin.swift"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.swift; explicitFileType = undefined; includeInIndex = 0; };
A30AA6EAA92B40E48EC70E02 /* SwiftData.swift */ = {isa = PBXFileReference; name = "SwiftData.swift"; path = "cordova-plugin-geofence/SwiftData.swift"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.swift; explicitFileType = undefined; includeInIndex = 0; };
0E4C96B470E64453A6719122 /* SwiftyJson.swift */ = {isa = PBXFileReference; name = "SwiftyJson.swift"; path = "cordova-plugin-geofence/SwiftyJson.swift"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.swift; explicitFileType = undefined; includeInIndex = 0; };
CD2175113103459FABE6A608 /* Geo-Bridging-Header.h */ = {isa = PBXFileReference; name = "Geo-Bridging-Header.h"; path = "cordova-plugin-geofence/Geo-Bridging-Header.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
8CB7C6AB6F42484E9E0A0D32 /* libsqlite3.dylib */ = {isa = PBXFileReference; name = "libsqlite3.dylib"; path = "usr/lib/libsqlite3.dylib"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = compiled.mach-o.dylib; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
301BF552109A68D80062928A /* libCordova.a in Frameworks */,
2B31C62D126249EF8E3EC749 /* libsqlite3.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
302D95EE14D2391D003F00A1 /* MainViewController.h */,
302D95EF14D2391D003F00A1 /* MainViewController.m */,
302D95F014D2391D003F00A1 /* MainViewController.xib */,
1D3623240D0F684500981E51 /* AppDelegate.h */,
1D3623250D0F684500981E51 /* AppDelegate.m */,
);
name = Classes;
path = "swift-test/Classes";
sourceTree = SOURCE_ROOT;
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
1D6058910D05DD3D006BFB54 /* swift-test.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
EB87FDF41871DAF40020F90C /* config.xml */,
EB87FDF31871DA8E0020F90C /* www */,
EB87FDF11871DA420020F90C /* Staging */,
301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */,
080E96DDFE201D6D7F000001 /* Classes */,
307C750510C5A3420062BCA9 /* Plugins */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = CustomTemplate;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
32CA4F630368D1EE00C91783 /* swift-test-Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */,
);
name = "Other Sources";
path = "swift-test";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
0207DA571B56EA530066E2B4 /* Images.xcassets */,
3047A50E1AB8057F00498E2A /* config */,
8D1107310486CEB800E47090 /* swift-test-Info.plist */,
);
name = Resources;
path = "swift-test/Resources";
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
8CB7C6AB6F42484E9E0A0D32 /* libsqlite3.dylib */,
);
name = Frameworks;
sourceTree = "<group>";
};
301BF52E109A57CC0062928A /* Products */ = {
isa = PBXGroup;
children = (
301BF535109A57CC0062928A /* libCordova.a */,
);
name = Products;
sourceTree = "<group>";
};
3047A50E1AB8057F00498E2A /* config */ = {
isa = PBXGroup;
children = (
3047A50F1AB8059700498E2A /* build-debug.xcconfig */,
3047A5101AB8059700498E2A /* build-release.xcconfig */,
3047A5111AB8059700498E2A /* build.xcconfig */,
);
name = config;
sourceTree = "<group>";
};
307C750510C5A3420062BCA9 /* Plugins */ = {
isa = PBXGroup;
children = (
E3F8D41EE3554DC3BBB512B7 /* CDVLogger.m */,
D2DA96555B65426F9B7A6BDD /* CDVLogger.h */,
ADCBB40757A24067AF77D95F /* CDVDevice.m */,
310BBF5A06F8488CB7721030 /* CDVDevice.h */,
4F21B1DA0CF44CD29C59A070 /* CDVSplashScreen.m */,
E50FCF3F6C5B4E2CB058DA9A /* CDVViewController+SplashScreen.m */,
E485D177C010453B97647205 /* CDVSplashScreen.h */,
E4C6D0F8FA454923BC1DD02A /* CDVViewController+SplashScreen.h */,
28FDE6B02758455C87F7384C /* CDVStatusBar.m */,
4431D3A441D344A18FE35B8F /* CDVStatusBar.h */,
7BF59A8AD2D14CAE8022A276 /* IonicKeyboard.m */,
A8999E4035094CA7A2641003 /* IonicKeyboard.h */,
C30458F25F294C17B7D9B03A /* GeofencePlugin.swift */,
A30AA6EAA92B40E48EC70E02 /* SwiftData.swift */,
0E4C96B470E64453A6719122 /* SwiftyJson.swift */,
CD2175113103459FABE6A608 /* Geo-Bridging-Header.h */,
);
name = Plugins;
path = "swift-test/Plugins";
sourceTree = SOURCE_ROOT;
};
EB87FDF11871DA420020F90C /* Staging */ = {
isa = PBXGroup;
children = (
F840E1F0165FE0F500CFE078 /* config.xml */,
301BF56E109A69640062928A /* www */,
);
name = Staging;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
1D6058900D05DD3D006BFB54 /* swift-test */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "swift-test" */;
buildPhases = (
304B58A110DAC018002A0835 /* Copy www directory */,
1D60588D0D05DD3D006BFB54 /* Resources */,
1D60588E0D05DD3D006BFB54 /* Sources */,
1D60588F0D05DD3D006BFB54 /* Frameworks */,
);
buildRules = (
);
dependencies = (
301BF551109A68C00062928A /* PBXTargetDependency */,
);
name = "swift-test";
productName = "swift-test";
productReference = 1D6058910D05DD3D006BFB54 /* swift-test.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 510;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__NON-CLI__" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = 301BF52E109A57CC0062928A /* Products */;
ProjectRef = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */;
},
);
projectRoot = "";
targets = (
1D6058900D05DD3D006BFB54 /* swift-test */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
301BF535109A57CC0062928A /* libCordova.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libCordova.a;
remoteRef = 301BF534109A57CC0062928A /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
1D60588D0D05DD3D006BFB54 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */,
3047A5131AB8059700498E2A /* build-release.xcconfig in Resources */,
3047A5141AB8059700498E2A /* build.xcconfig in Resources */,
0207DA581B56EA530066E2B4 /* Images.xcassets in Resources */,
3047A5121AB8059700498E2A /* build-debug.xcconfig in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
304B58A110DAC018002A0835 /* Copy www directory */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy www directory";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "NODEJS_PATH=/usr/local/bin; NVM_NODE_PATH=~/.nvm/versions/node/`nvm version 2>/dev/null`/bin; N_NODE_PATH=`find /usr/local/n/versions/node/* -maxdepth 0 -type d 2>/dev/null | tail -1`/bin; XCODE_NODE_PATH=`xcode-select --print-path`/usr/share/xcs/Node/bin; PATH=$NODEJS_PATH:$NVM_NODE_PATH:$N_NODE_PATH:$XCODE_NODE_PATH:$PATH && node cordova/lib/copy-www-build-step.js";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
1D60588E0D05DD3D006BFB54 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */,
302D95F114D2391D003F00A1 /* MainViewController.m in Sources */,
14747B47F6EF4384B3D76B11 /* CDVLogger.m in Sources */,
FBD5A33841474247A1EFA3F2 /* CDVDevice.m in Sources */,
0EB9E8FCB5414DC183FE81C1 /* CDVSplashScreen.m in Sources */,
3326E29675484E738CF20B86 /* CDVViewController+SplashScreen.m in Sources */,
435307A1A8B64099898B261B /* CDVStatusBar.m in Sources */,
FB9D21F873E74009B4FF3B93 /* IonicKeyboard.m in Sources */,
2A514E297F744057B7D8E1E3 /* GeofencePlugin.swift in Sources */,
62D789781CD2489FA3490006 /* SwiftData.swift in Sources */,
0B274BD7666744ADBD31319A /* SwiftyJson.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
301BF551109A68C00062928A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = CordovaLib;
targetProxy = 301BF550109A68C00062928A /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3047A50F1AB8059700498E2A /* build-debug.xcconfig */;
buildSettings = {
SWIFT_VERSION = 2.3;
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "swift-test/swift-test-Prefix.pch";
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = "";
INFOPLIST_FILE = "swift-test/swift-test-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
PRODUCT_NAME = "swift-test";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
};
name = Debug;
};
1D6058950D05DD3E006BFB54 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3047A5101AB8059700498E2A /* build-release.xcconfig */;
buildSettings = {
SWIFT_VERSION = 2.3;
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "swift-test/swift-test-Prefix.pch";
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = "";
INFOPLIST_FILE = "swift-test/swift-test-Info.plist";
PRODUCT_NAME = "swift-test";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3047A5111AB8059700498E2A /* build.xcconfig */;
buildSettings = {
SWIFT_VERSION = 2.3;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = "";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SKIP_INSTALL = NO;
PRODUCT_NAME = "swift-test";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3047A5111AB8059700498E2A /* build.xcconfig */;
buildSettings = {
SWIFT_VERSION = 2.3;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = "";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
SDKROOT = iphoneos;
SKIP_INSTALL = NO;
PRODUCT_NAME = "swift-test";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "swift-test" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1D6058940D05DD3E006BFB54 /* Debug */,
1D6058950D05DD3E006BFB54 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__NON-CLI__" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}
Some plugins do not compile with Swift 2.3 however, and in these cases the build process will still fail.
Interesting - on a more complex app (with 14 Cordova/IN plugins) there are still only 4 buildSettings directives in the project.pbxproj file. Adding the SWIFT_VERSION tag to these 4 spots will make the app compile, but one of the plugins (https://www.npmjs.com/package/cordova-plugin-zeroconf) fails due to Swift syntax errors.
Alright, project compiles properly after settings SWIFT_VERSION = 3.0 in the project.pbxproj file.
Next step is figuring out how to get the SWIFT_VERSION line in that file by default.
The Temp fix that i used was the same as @emcniece but i used a different version here is a portion of the project.pbxproj file that i changed
NOTE: There are 4 places named buildSettings = {} in this file to add this line too.
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3047A5111AB8059700498E2A /* build.xcconfig */;
buildSettings = {
SWIFT_VERSION = 2.3; /* <<<<<------- This is the change i made */
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = "";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SKIP_INSTALL = NO;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
};
name = Debug;
};
After you change the version number. Do you do another ionic build or just directly use xcode? For me, the build itself fails because of the same error.