cowbell / ionic-geofence

Ionic geofence app example
MIT License
180 stars 92 forks source link

ios Build error #8

Closed bx5974 closed 9 years ago

bx5974 commented 9 years ago

when i do

$ ionic build ios

\ BUILD FAILED **

The following build commands failed: CompileSwift normal i386 /Users/bx/ionic/geoFenTry/platforms/ios/geoFenTry/Plugins/com.cowbell.cordova.geofence/GeofencePlugin.swift CompileSwift normal i386 /Users/bx/ionic/geoFenTry/platforms/ios/geoFenTry/Plugins/com.cowbell.cordova.geofence/SwiftData.swift CompileSwiftSources normal i386 com.apple.xcode.tools.swift.compiler (3 failures) Error code 65 for command: xcodebuild with args: -xcconfig,/Users/bx/ionic/geoFenTry/platforms/ios/cordova/build-debug.xcconfig,-project,geoFenTry.xcodeproj,ARCHS=i386,-target,geoFenTry,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/bx/ionic/geoFenTry/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/bx/ionic/geoFenTry/platforms/ios/build/sharedpch ERROR building one of the platforms: Error: /Users/bx/ionic/geoFenTry/platforms/ios/cordova/build: Command failed with exit code 2 You may not have the required environment or OS to build this project Error: /Users/bx/ionic/geoFenTry/platforms/ios/cordova/build: Command failed with exit code 2 at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23) at ChildProcess.emit (events.js:110:17) at maybeClose (child_process.js:1015:16) at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

tsubik commented 9 years ago

Hey. Which version of xcode do you have? I've recently merged some changes to support xcode 8.3 and swift 1.2 and there is no backwards compability between swift 1.2 and 1.1 :tired_face:

bx5974 commented 9 years ago

Hello,

I use XCode Version 6.3.1

Cloned the master Repo and tried again. Could you please help get & use that latest merged code?

\ BUILD FAILED **

The following build commands failed: CompileSwift normal i386 /Users/bx/ionic/ionic-geofence/platforms/ios/ionic-geofence/Plugins/com.cowbell.cordova.geofence/GeofencePlugin.swift CompileSwift normal i386 /Users/bx/ionic/ionic-geofence/platforms/ios/ionic-geofence/Plugins/com.cowbell.cordova.geofence/SwiftData.swift CompileSwiftSources normal i386 com.apple.xcode.tools.swift.compiler (3 failures) Error code 65 for command: xcodebuild with args: -xcconfig,/Users/bx/ionic/ionic-geofence/platforms/ios/cordova/build-debug.xcconfig,-project,ionic-geofence.xcodeproj,ARCHS=i386,-target,ionic-geofence,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/bx/ionic/ionic-geofence/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/bx/ionic/ionic-geofence/platforms/ios/build/sharedpch ERROR building one of the platforms: Error: /Users/bx/ionic/ionic-geofence/platforms/ios/cordova/build: Command failed with exit code 2 You may not have the required environment or OS to build this project Error: /Users/bx/ionic/ionic-geofence/platforms/ios/cordova/build: Command failed with exit code 2 at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23) at ChildProcess.emit (events.js:110:17) at maybeClose (child_process.js:1015:16) at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

TomDoesb commented 9 years ago

First i get a dependency error, because of the deployment targets, when i fix these i get the same problem as bx5974

Libtool /Users/Tom/Downloads/ionic-geofence-master/platforms/ios/build/emulator/libCordova.a normal i386 cd /Users/Tom/Downloads/ionic-geofence-master/platforms/ios/CordovaLib export IPHONEOS_DEPLOYMENT_TARGET=6.0 export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/opt/local/bin:/opt/local/sbin:/opt/local/lib/postgresql94/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/gradle-1.12:/opt/X11/bin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only i386 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk -L/Users/Tom/Downloads/ionic-geofence-master/platforms/ios/build/emulator -filelist /Users/Tom/Downloads/ionic-geofence-master/platforms/ios/CordovaLib/build/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Objects-normal/i386/Cordova.LinkFileList -o /Users/Tom/Downloads/ionic-geofence-master/platforms/ios/build/emulator/libCordova.a

=== BUILD TARGET ionic-geofence OF PROJECT ionic-geofence WITH CONFIGURATION Debug ===

Check dependencies Swift is unavailable on iOS earlier than 7.0; please set IPHONEOS_DEPLOYMENT_TARGET to 7.0 or later (currently it is '6.0').

Seems to be an issue with the deployment target settings of the cordova lib, when i fix these i'm getting the same issues as bx5974 .

The following build commands failed: CompileSwift normal i386 /Users/Tom/Downloads/ionic-geofence-master/platforms/ios/ionic-geofence/Plugins/com.cowbell.cordova.geofence/GeofencePlugin.swift CompileSwift normal i386 /Users/Tom/Downloads/ionic-geofence-master/platforms/ios/ionic-geofence/Plugins/com.cowbell.cordova.geofence/SwiftData.swift CompileSwiftSources normal i386 com.apple.xcode.tools.swift.compiler (3 failures) Error code 65 for command: xcodebuild with args: -xcconfig,/Users/Tom/Downloads/ionic-geofence-master/platforms/ios/cordova/build-debug.xcconfig,-project,ionic-geofence.xcodeproj,ARCHS=i386,-target,ionic-geofence,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/Tom/Downloads/ionic-geofence-master/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/Tom/Downloads/ionic-geofence-master/platforms/ios/build/sharedpch

This was on xcode 6.3.1

tsubik commented 9 years ago

After the geofence plugin is installed all needed settings to support swift should be set. There is a hook for this. Try to clear everything ionic state clear and add platform once again ionic platform add ios. Make sure everything is correctly installed you should see something similar to this in your logs:

Creating new Bridging-Header.h at path:  /Users/tomasz/dev/ionic-geofence/platforms/ios/ionic-geofence/Plugins/Bridging-Header.h
Importing Geo-Bridging-Header.h into main bridging-header at: /Users/tomasz/dev/ionic-geofence/platforms/ios/ionic-geofence/Plugins/Bridging-Header.h
IOS project now has deployment target set as:[7.0] ...
IOS project option EMBEDDED_CONTENT_CONTAINS_SWIFT set as:[YES] ...
IOS project swift_objc Bridging-Header set to:[/Users/tomasz/dev/ionic-geofence/platforms/ios/ionic-geofence/Plugins/Bridging-Header.h] ...
IOS project Runpath Search Paths set to: @executable_path/Frameworks ...
IOS project Adding libsqlite3...
TomDoesb commented 9 years ago

Thanks, this fixed the problem for me