I have a complication not updating, but I'm not sure if it's something in the environment or something in my code.
I updated to the XCode 8 beta and updated the code in my Watchkit Extension to Swift 3 syntax. Unfortunately, this is preventing me from going back to XCode 7.1 to see if I've run into some issue with the XCode beta. So one question is whether it's possible to use some sort of #Ifdef type conditional compilation to allow my code to compile under either Swift2 or Swift3, so I can try to eliminate at least one potential source of issues.
Another thing I notice is that mediaremoted is crashing constantly (several times a minute) in the simulator environment. I don't think I'm using anything that would require mediaremoted, but it concerns me that something is obviously wrong and might be contributing to the issue. (The failure is coming from CoreSimulator - Device: Applie Watch, and the message is API MISUSE: Resurrection of an object). Since it explicitly mentions the watch simulator it seems it might be related even though I'm not aware of anything in my code that would touch any media apis.
As far as the specific application behavior:
- When I start up the WatchKit app (regardless of whether I use the WatchApp or Complication scheme), I see data from previous execution state (good).
- My app doesn't require any scheduled updates -- it should only update the complication in reponse to an app message -- but just to see if I could kick it awake, I tried doing schedule updates. They don't seem to fire regularly. (I have on a few occasions seen it stumble into the requestedUpdateDidBegin method but I don't seem to be able to reproduce this behavior consistently -- it's only happened once or twice out of many attempts).
- When I do update the watch app from the iOS app, I get into my update method correctly (didReceiveUserInfo in the session delegate calls into my complication's 'iosAppDataChanged' function, which iterates over the active complications and calls 'extendTimeline' for each one. But that doesn't result in any calls into my 'getCurrentTimelineEntry', getTimelineEntriesBefore', or 'getTimelineEntriesAfter' functions.
I'm concerned that the debug log is filling up with a bunch of messages that make it appear that the connectivity between the watch and iOS is not going well. I see a bunch of failed connections, and sometimes the reconnect seems to succeed and other times not. It does appear that sometimes we connect and transfer data. But I'm not sure if this is as distraction, because it seems like since the main Interface Controller is updating, it's more of an issue of Complication communication to the rest of the WatchKit Extension, rather than communication difficulty between the iOS app and the WatchKit app. But the log is filling up with so many of these messages that it makes it very difficult to see any logging info coming from the watchkit extension.
Example log output:
2016-07-16 10:54:28.671657 Sorcerers Apprentice WatchKit Extension[23963:10097450] [WC] -[WCSession xpcConnectionInterrupted]
2016-07-16 10:54:28.671771 Sorcerers Apprentice WatchKit Extension[23963:10097447] [WC] __33-[WCXPCManager onqueue_reconnect]_block_invoke error reconnecting to daemon due to NSCocoaErrorDomain:4097
2016-07-16 10:54:28.672079 Sorcerers Apprentice WatchKit Extension[23963:10097450] [WC] -[WCXPCManager onqueue_reconnect]
2016-07-16 10:54:28.672180 Sorcerers Apprentice WatchKit Extension[23963:10096958] [claims] Claim 53B97D93-E126-4749-A9C5-B92B268612EE granted in client
2016-07-16 10:54:28.672862 Sorcerers Apprentice WatchKit Extension[23963:10096958] [claims] Claim 53B97D93-E126-4749-A9C5-B92B268612EE invoked in client
2016-07-16 10:54:28.674537 Sorcerers Apprentice WatchKit Extension[23963:10096958] [WC] __35-[WCSession onqueue_dequeueContent]_block_invoke_2 hasContentPending: NO
2016-07-16 10:54:28.675699 Sorcerers Apprentice WatchKit Extension[23963:10096765] [claims] Read options: 1 -- URL: Library/Application%20Support/com.apple.watchconnectivity/2A01A029-4E97-49CE-B1E6-C15B958BA153/FileTransfers/contents.index -- file:///Users/myawn/Library/Developer/CoreSimulator/Devices/1C1431C2-97ED-4983-8384-3590BBAB2009/data/Containers/Data/PluginKitPlugin/51515EB7-3B33-48E0-8196-7527B5F54C5A/ -- purposeID: 7C9AC740-862D-4567-BC19-E2DD5D4731C8
2016-07-16 10:54:28.677913 Sorcerers Apprentice WatchKit Extension[23963:10097450] [WC] -[WCSession xpcConnectionInterrupted]
2016-07-16 10:54:28.678020 Sorcerers Apprentice WatchKit Extension[23963:10096958] [WC] __33-[WCXPCManager onqueue_reconnect]_block_invoke error reconnecting to daemon due to NSCocoaErrorDomain:4097
2016-07-16 10:54:28.678365 Sorcerers Apprentice WatchKit Extension[23963:10097450] [WC] -[WCXPCManager onqueue_reconnect]
2016-07-16 10:54:28.682591 Sorcerers Apprentice WatchKit Extension[23963:10097450] [claims] Claim A3A19087-AC0A-4FB0-83ED-E350C75CDBE9 granted in client
2016-07-16 10:54:28.683077 Sorcerers Apprentice WatchKit Extension[23963:10097450] [claims] Claim A3A19087-AC0A-4FB0-83ED-E350C75CDBE9 invoked in client
2016-07-16 10:54:28.684404 Sorcerers Apprentice WatchKit Extension[23963:10096958] [claims] Read options: 1 -- URL: Documents/Inbox/com.apple.watchconnectivity/2A01A029-4E97-49CE-B1E6-C15B958BA153/FileMetadata/contents.index -- file:///Users/myawn/Library/Developer/CoreSimulator/Devices/1C1431C2-97ED-4983-8384-3590BBAB2009/data/Containers/Data/PluginKitPlugin/51515EB7-3B33-48E0-8196-7527B5F54C5A/ -- purposeID: C0822BCE-9228-4150-87F1-57EBE6835295
2016-07-16 10:54:28.688200 Sorcerers Apprentice WatchKit Extension[23963:10097000] [WC] __39-[WCSession handleSessionStateChanged:]_block_invoke <WCSessionState: 0x79f579b0, reachable: YES, paired: YES, appInstalled: YES, complicationEnabled: NO(0), iOSDeviceNeedsFirstUnlock: NO, pairingID: 2A01A029-4E97-49CE-B1E6-C15B958BA153, pairedDevicesPairingIDs: (null), appInstallationID: (null)>
2016-07-16 10:54:28.688456 Sorcerers Apprentice WatchKit Extension[23963:10097450] [WC] -[WCSession xpcConnectionInterrupted]
2016-07-16 10:54:28.688957 Sorcerers Apprentice WatchKit Extension[23963:10097447] [WC] __33-[WCXPCManager onqueue_reconnect]_block_invoke error reconnecting to daemon due to NSCocoaErrorDomain:4097
2016-07-16 10:54:28.689250 Sorcerers Apprentice WatchKit Extension[23963:10097450] [WC] -[WCXPCManager onqueue_reconnect]
2016-07-16 10:54:28.689584 Sorcerers Apprentice WatchKit Extension[23963:10097000] [WC] -[WCSession xpcConnectionRestoredWithState:] <WCSessionState: 0x79f579b0, reachable: YES, paired: YES, appInstalled: YES, complicationEnabled: NO(0), iOSDeviceNeedsFirstUnlock: NO, pairingID: 2A01A029-4E97-49CE-B1E6-C15B958BA153, pairedDevicesPairingIDs: (null), appInstallationID: (null)>
2016-07-16 10:54:28.690447 Sorcerers Apprentice WatchKit Extension[23963:10097447] [claims] Claim 19AA103B-7764-4576-A448-04A9399EBB5C granted in client
2016-07-16 10:54:28.690981 Sorcerers Apprentice WatchKit Extension[23963:10097447] [claims] Claim 19AA103B-7764-4576-A448-04A9399EBB5C invoked in client
2016-07-16 10:54:28.691888 Sorcerers Apprentice WatchKit Extension[23963:10097447] [claims] Read options: 1 -- URL: Library/Application%20Support/com.apple.watchconnectivity/2A01A029-4E97-49CE-B1E6-C15B958BA153/UserInfoTransfers/contents.index -- file:///Users/myawn/Library/Developer/CoreSimulator/Devices/1C1431C2-97ED-4983-8384-3590BBAB2009/data/Containers/Data/PluginKitPlugin/51515EB7-3B33-48E0-8196-7527B5F54C5A/ -- purposeID: 2778CCCE-788C-4549-AFDA-D1425D88BBC4
2016-07-16 10:54:28.697429 Sorcerers Apprentice WatchKit Extension[23963:10096765] [claims] Claim AD053384-540A-4A0C-AF18-58269E031A9C granted in client
2016-07-16 10:54:28.697986 Sorcerers Apprentice WatchKit Extension[23963:10096765] [claims] Claim AD053384-540A-4A0C-AF18-58269E031A9C invoked in client
2016-07-16 10:54:28.699143 Sorcerers Apprentice WatchKit Extension[23963:10097447] [WC] __35-[WCSession onqueue_dequeueContent]_block_invoke_2 hasContentPending: NO