Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23614] iOS10: Titanium with Swift Watch App fails to build on Xcode 8.0 Beta

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-08-24T21:04:28.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.5.0
ComponentsiOS, Tooling
Labelsqe-5.5.0, watchOS3
ReporterChee Kiat Ng
AssigneeJan Vennemann
Created2016-07-05T04:05:04.000+0000
Updated2016-08-24T21:04:46.000+0000

Description

Comments

  1. Chee Kiat Ng 2016-07-11

    Saw this on Xcode 8 release notes. maybe useful: {quote}The version of Swift 2 (2.3) used in Xcode 8 is very close to the version used in Xcode 7.3.1. However, it has been updated for the newer SDKs, and therefore is not compatible with Swift frameworks compiled in Xcode 7.3.1. Distributing binary Swift frameworks remains unsupported in Xcode 8. (25680392){quote}
  2. Chee Kiat Ng 2016-07-18

    [~jvennemann] [~hansknoechel] The PR fixed partially the problem. Try the run case above again. you'll see this error:
       [ERROR] Specified Watch Simulator "C8C0ED0B-627A-4789-BD1B-DC70094737E9" is not compatible with iOS Simulator "507666A6-38FF-4972-9D8B-C11D9D20AD19".
       
    If you check appc ti info you will see the device id and watch id does corresponding to iOS10 and watchOS 3.0 so for some reason it thinks it's an error. This might be an ioslib detection issue, that will require [~cbarber] to help take a look at.
  3. Chris Barber 2016-07-18

    The error is coming from ioslib. simctl does not tell which Watch Simulators can be paired with which iOS Simulators, so I created a lookup table that must be manually maintained: https://github.com/appcelerator/ioslib/blob/master/lib/simulator.js#L73-L96. It'll take some trial and error figure out the correct compatibility, but it should be pretty easy. I'd be happy to fix it when I'm back.
  4. Jan Vennemann 2016-07-18

  5. Harry Bryant 2016-08-18

    I am still able to reproduce this issue. Here is the test case I ran: 1. appc new --classic (and another project as a default Alloy Project) 2. Enter project root 3. appc new -t applewatch 3. Specified the <team-id> property in the tiapp.xml 4. appc run -p ios -I 10.0 --launch-watch-app -l trace *Logs:*
       [TRACE] /Users/harrybryant/Documents/Watch_Tests/watchTest4/build/iphone/extensions/watchTest4/watchTest4 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/harrybryant/Documents/Watch_Tests/watchTest4/build/iphone/extensions/watchTest4/watchTest4 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] <unknown>:0: note: 'awakeWithContext' has been explicitly marked unavailable here
       [TRACE] /Users/harrybryant/Documents/Watch_Tests/watchTest4/build/iphone/extensions/watchTest4/watchTest4 WatchKit Extension/InterfaceController.swift:20:37: error: 'defaultSession()' has been renamed to 'default()'
       [TRACE]             let session = WCSession.defaultSession()
       [TRACE]                                     ^~~~~~~~~~~~~~
       [TRACE]                                     default
       [TRACE] <unknown>:0: note: 'defaultSession()' has been explicitly marked unavailable here
       [TRACE] /Users/harrybryant/Documents/Watch_Tests/watchTest4/build/iphone/extensions/watchTest4/watchTest4 WatchKit Extension/InterfaceController.swift:22:21: error: 'activateSession()' has been renamed to 'activate()'
       [TRACE]             session.activateSession()
       [TRACE]                     ^~~~~~~~~~~~~~~
       [TRACE]                     activate
       [TRACE] <unknown>:0: note: 'activateSession()' has been explicitly marked unavailable here
       [TRACE] /Users/harrybryant/Documents/Watch_Tests/watchTest4/build/iphone/extensions/watchTest4/watchTest4 WatchKit Extension/InterfaceController.swift:27:15: error: 'awakeWithContext' has been renamed to 'awake(withContext:)'
       [TRACE]         super.awakeWithContext(context)
       [TRACE]               ^~~~~~~~~~~~~~~~
       [TRACE]               awake            withContext: 
       [TRACE] <unknown>:0: note: 'awakeWithContext' has been explicitly marked unavailable here
       [ERROR] ** BUILD FAILED **
       [ERROR] The following build commands failed:
       [ERROR]         CompileSwift normal i386 /Users/harrybryant/Documents/Watch_Tests/watchTest4/build/iphone/extensions/watchTest4/watchTest4 WatchKit Extension/InterfaceController.swift
       [ERROR]         CompileSwiftSources normal i386 com.apple.xcode.tools.swift.compiler
       [ERROR] (2 failures)
       
    Tested On: iPhone 6S (10.0) Simulator WatchOS3 (3.0) Simulator Mac OSX El Capitan 10.11.6 Ti SDK: 5.5.0.v20160816120242 Appc Studio: 4.7.0.201607250649 Appc NPM: 4.2.7 App CLI: 5.5.0-5 Xcode 8.0 beta 6 (8S193k) Node v4.4.7 *Reopening Ticket.*
  6. Chris Barber 2016-08-19

    Confirmed. Here's the TiSDK master PR for this ticket: https://github.com/appcelerator/titanium_mobile/pull/8120 [~jvennemann] Please be sure to add a link to the PR in the ticket for which it resolves. [~jvennemann] Also, this PR needs to be backported to 5_5_X so that [~htbryant] can close this ticket. Thanks!
  7. Jan Vennemann 2016-08-19

    Oh sorry, i must have missed to post the PR link for this one. Here is the 5.5.X backport: https://github.com/appcelerator/titanium_mobile/pull/8243
  8. Chee Kiat Ng 2016-08-22

    backport tested and merged.
  9. Jan Vennemann 2016-08-22

    Since the API changed when i did the original fix, the master and 6.0.x branch also need to be updated. PR (master): https://github.com/appcelerator/titanium_mobile/pull/8248 PR (6_0_X): https://github.com/appcelerator/titanium_mobile/pull/8249
  10. Harry Bryant 2016-08-23

    I am still able to reproduce issue, tested with the latest SDK build (5.5.0.v20160822000355) and the same error occurs when trying to build. Checked the PR against my SDK under _templates/applewatch/watchos2-swift/template/WatchkitExtName/InterfaceController.swift.ejs_ and verified that the change is present. *Reopening Ticket.*
  11. Jan Vennemann 2016-08-23

    [~htbryant], are you using the latest Xcode 8 Beta 6?
  12. Harry Bryant 2016-08-23

    [~jvennemann] I asked [~ewieber] to validate and he did not experience the issue. After further investigation I found that my xcode configuration was not as it should be. I removed my Xcode Beta and did a fresh install, and I no longer encounter the issue. I can confirm that I am able to build a Titanium app with a Swift Watch app on Xcode 8.0 Beta 6, for Simulators. However, I am encountering issues with Devices as a target. The Titanium app installs without problem on the iPhone 6S (iOS10 beta 7), but when attempting to install the app on the watch device, it fails to do so. This is currently under investigation by myself and [~ewieber], who will report on his findings when he gets the opportunity to validate. Tested On: iPhone 6S (10.0) Device & Simulator Apple Watch (OS 3.0) Device & Simulator Mac OSX El Capitan 10.11.6 Ti SDK: 5.5.0.v20160822000355 Appc Studio: 4.7.1.201608190732 Appc NPM: 4.2.7 App CLI: 5.5.0-5 Version 8.0 beta 6 Node v4.4.7
  13. Hans Knöchel 2016-08-24

    Probably somewhere the swift-version is set to 2.3 but needs to be 3.0 OR have the legacy-flag in it? -The MySwift.swift file has correct Swift 3 syntax (which is the same as Swift 2.x here, since it's a very simple UIImageView). #my2cents- *EDIT*: Whoops, that was for TIMOB-23808.
  14. Jan Vennemann 2016-08-24

    The SWIFT_VERSION build settings in the extension's project.pbxproj should be set to 3.0. This will be set by [this template](https://github.com/appcelerator/titanium_mobile/blob/master/templates/applewatch/watchos2-swift/template/ExtName.xcodeproj/project.pbxproj.ejs#L336). I think Xcode changed that when i opened the project manually and it still had old swift syntax in it, so that's another thing you could look at.
  15. Harry Bryant 2016-08-24

    [~jvennemann] [~hansknoechel] , [~ewieber] and I finally isolated the problem down to our provisioning profiles, and after removing our current ones and installing newly configured profiles, were able to install watch apps without any issue. Resolving this ticket as fixed. Tested On: iPhone 6S (10.0) Device & Simulator Apple Watch (OS3) Device & Simulator Mac OSX El Capitan 10.11.6 Ti SDK: 5.5.0.v20160822000355 Appc Studio: 4.7.1.201608190732 Appc NPM: 4.2.7 App CLI: 5.5.0-5 Version 8.0 beta 6 (8S201h) Node v4.4.7 *Closing ticket.*

JSON Source