Project: titanium
Issue TIMOB-23614: iOS10: Titanium with Swift Watch App fails to build on Xcode 8.0 Beta
Build Errors out when trying to build app with watchapp on Xcode 8.0 beta h4. Steps to reproduce 1. *appc new --classic* 2. Enter project root 3. *appc new -t applewatch* 4. *appc run -p ios -I 10.0 --launch-watch-app -l trace* h4. Expected result App launches successfully with both iOS and watch simulators h4. Actual result Build fails with the following error: {code} /Users/kiat/titaniumTestWatch/SGTestWatch2/build/iphone/extensions/SGTestWatch2/SGTestWatch2 WatchKit Extension/InterfaceController.swift:26:19: error: argument names for method 'awakeWithContext(context:)' do not match those of overridden method 'awakeWithContext' [TRACE] override func awakeWithContext(context: AnyObject?) { [TRACE] ^ [TRACE] _ [TRACE] /Users/kiat/titaniumTestWatch/SGTestWatch2/build/iphone/extensions/SGTestWatch2/SGTestWatch2 WatchKit Extension/InterfaceController.swift:26:19: error: 'awakeWithContext' has been renamed to 'awake(withContext:)' [TRACE] override func awakeWithContext(context: AnyObject?) { [TRACE] ^~~~~~~~~~~~~~~~ [TRACE] awake withContext [TRACE] :0: note: 'awakeWithContext' has been explicitly marked unavailable here [TRACE] /Users/kiat/titaniumTestWatch/SGTestWatch2/build/iphone/extensions/SGTestWatch2/SGTestWatch2 WatchKit Extension/InterfaceController.swift:14:7: error: type 'InterfaceController' does not conform to protocol 'WCSessionDelegate' [TRACE] class InterfaceController: WKInterfaceController, WCSessionDelegate { [TRACE] ^ [TRACE] WatchConnectivity.WCSessionDelegate:10:17: note: protocol requires function 'session(_:activationDidCompleteWith:error:)' with type '(WCSession, activationDidCompleteWith: WCSessionActivationState, error: NSError?) -> Void' [TRACE] public func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: NSError?) [TRACE] ^ [TRACE] /Users/kiat/titaniumTestWatch/SGTestWatch2/build/iphone/extensions/SGTestWatch2/SGTestWatch2 WatchKit Extension/InterfaceController.swift:20:37: error: 'defaultSession()' has been renamed to 'default()' [TRACE] let session = WCSession.defaultSession() [TRACE] ^~~~~~~~~~~~~~ [TRACE] default [TRACE] :0: note: 'defaultSession()' has been explicitly marked unavailable here [TRACE] /Users/kiat/titaniumTestWatch/SGTestWatch2/build/iphone/extensions/SGTestWatch2/SGTestWatch2 WatchKit Extension/InterfaceController.swift:22:21: error: 'activateSession()' has been renamed to 'activate()' [TRACE] session.activateSession() [TRACE] ^~~~~~~~~~~~~~~ [TRACE] activate [TRACE] :0: note: 'activateSession()' has been explicitly marked unavailable here [TRACE] /Users/kiat/titaniumTestWatch/SGTestWatch2/build/iphone/extensions/SGTestWatch2/SGTestWatch2 WatchKit Extension/InterfaceController.swift:27:15: error: 'awakeWithContext' has been renamed to 'awake(withContext:)' [TRACE] super.awakeWithContext(context) [TRACE] ^~~~~~~~~~~~~~~~ [TRACE] awake withContext: [TRACE] :0: note: 'awakeWithContext' has been explicitly marked unavailable here [ERROR] ** BUILD FAILED ** [ERROR] The following build commands failed: [ERROR] CompileSwift normal i386 /Users/kiat/titaniumTestWatch/SGTestWatch2/build/iphone/extensions/SGTestWatch2/SGTestWatch2 WatchKit Extension/InterfaceController.swift [ERROR] CompileSwiftSources normal i386 com.apple.xcode.tools.swift.compiler [ERROR] (2 failures) {code} *Note* It's likely to do with the support for the right swift versions, and the template we used to generate the watch extension should be updated (and remain backward compatible) Also, if you can get past this and it fails with a different error related to Xcode 8.0 beta (https://jira.appcelerator.org/browse/TIMOB-23518) You can work around by commenting out this line: https://github.com/appcelerator/titanium_mobile/blob/master/iphone/cli/commands/_build.js#L5938 temporarily [~hansknoechel] please help if necessary.
Story points: 8