Conditionally Migrate WatchOS 10 users ONLY to WidgetKit

I'm looking to migrate my users ClockKit complications to WidgetKit in my next app update. I can only do this for WatchOS 10 users because the APIs are too limited for WatchOS 9 (eg. Widget corner round text not available). But I do need to do this for WatchOS 10 users in order to get in the Smart Stack.

When I tried to mark my getWidgetConfiguration method in my ComplicationController.swift with:

@available(watchOS 10.0, *)

it complains and says: Protocol 'CLKComplicationWidgetMigrator' requires 'getWidgetConfiguration(from:completionHandler:)' to be available in watchOS 9.0 and newer

I then tried modifying my WidgetKit extension to only support WatchOS 10. This seems to work for a while but at some point WatchOS 9 devices still try the migration and crash with symbolNotFound DYLD issues for the WidgetKit extension which shouldn't even be embedded in the WatchOS 9 builds! (all visible in iPhone Analytics data crashes)

So I'm not sure what else to try. I've researched a lot in docs etc... but can find no official way to achieve this.

Answered by DTS Engineer in 769942022

The circumstances around what you're seeing with these crash reports uncovered multiple issues present in builds of watchOS 9, and also early versions of watchOS 10, and the source of the issue was likely triggered when watchOS updated between watchOS versions with your app already installed.

The complete set of issues is resolved with the watchOS 10.2 beta that is now available. Upgrading to watchOS 10.2 is the best path so you no longer encounter these issues.

If you remain on watchOS 9 as part of testing your app, you can remove and reinstall your app as a workaround. For any of your customers using your app on watchOS 9, you can provide an update to your app, as the process of installing the update will also correct the issue.

I was dealing with the same problem but in my case the cause was somewhere else. Besides adding the widget extension, I also migrated to a single watchOS project target (there was a separate WatchKit extension before Xcode 14) and that caused the problem. The problem is described here https://developer.apple.com/forums/thread/729599 When I tried it without migrating to a single target, complications stayed untouched and worked correctly after updating the app on watchOS 9 and were successfully migrated on watchOS 10.

Still seeing the issue with build from the latest Xcode 15 Beta 8 and devices running WatchOS 9.6.X😕

Crash log from my widget extension on watchOS 9 (but the extension deployment target is watchOS 10). The missing symbol is _$s21DeveloperToolsSupport13ColorResourceV4name6bundleACSS_So8NSBundleCtcfC.

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: DYLD 4 Symbol missing
Symbol not found: _$s21DeveloperToolsSupport13ColorResourceV4name6bundleACSS_So8NSBundleCtcfC
Referenced from: <D018EC5D-C49D-387D-8E1D-52FBA6099567> /***.app/PlugIns/WatchComplications.appex/WatchComplications (built for watchOS 10.0 which is newer than running OS)
Expected in:     <3DEFD17C-9665-3448-964C-B3218FDE4DF9> /System/Library/Frameworks/DeveloperToolsSupport.framework/DeveloperToolsSupport
(terminated at launch; ignore backtrace)

Triggered by Thread:  0


Thread 0 Crashed:
0   dyld                          	0x000000006954ec5c __abort_with_payload + 8
1   dyld                          	0x000000006955a31c abort_with_payload_wrapper_internal + 100 (terminate_with_reason.c:102)
2   dyld                          	0x000000006955a34c abort_with_payload + 12 (terminate_with_reason.c:124)
3   dyld                          	0x00000000694f4740 dyld4::halt(char const*) + 332 (DyldProcessConfig.cpp:2758)
4   dyld                          	0x00000000694f2be0 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3484 (dyldMain.cpp:0)
5   dyld                          	0x00000000694f176c start + 1872 (dyldMain.cpp:1107)

And so many more from me:


Translated Report (Full Report Below)

Hardware Model:      Watch6,18
Identifier:          Sim.HeartRate.watchkitapp.WatchWidgetKitExtension
AppVariant:          1:Watch6,18:9
Code Type:           ARM64_32 (Native)
Role:                Unspecified
Parent Process:      launchd [1]

Date/Time:           2023-09-24 20:11:54.9181 -0500
Launch Time:         2023-09-24 20:11:54.0000 -0500
OS Version:          Watch OS 9.6.3 (20U502)
Release Type:        User
Baseband Version:    5.04.01
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: DYLD 4 Symbol missing
Symbol not found: _$s7SwiftUI17EnvironmentValuesV9WidgetKitE05ShowsE13BackgroundKeyVAA0cI0ADMc
Referenced from: <7BA88B36-F66D-3527-9C49-CE859AB79FCB> /Volumes/VOLUME/*/<APP_NAME>.app/PlugIns/<APP_NAME> Watch WidgetKit Extension.appex/<APP_NAME> Watch WidgetKit Extension **(built for watchOS 10.0 which is newer than running OS)**
Expected in:     <15E32CD8-4D76-3F93-9881-7F8FDBB8A288> /System/Library/Frameworks/WidgetKit.framework/WidgetKit
(terminated at launch; ignore backtrace)

Triggered by Thread:  0

Thread 0 Crashed:
0   dyld                          	        0x6dba6c5c 0x6db48000 + 388188
1   dyld                          	        0x6dbb231c 0x6db48000 + 434972
2   dyld                          	        0x6dbb234c 0x6db48000 + 435020
3   dyld                          	        0x6db4c740 0x6db48000 + 18240
4   dyld                          	        0x6db4abe0 0x6db48000 + 11232
5   dyld                          	        0x6db4976c 0x6db48000 + 5996

Feedback filed 1st August: FB12818485

Also reported: FB13213919

Still happening for devices running WatchOS 9.6.2 & 9.6.3 Any update on this Apple?

Just to share that the crash is a known issue, and the watchOS engineering is actively working on that.

Accepted Answer

The circumstances around what you're seeing with these crash reports uncovered multiple issues present in builds of watchOS 9, and also early versions of watchOS 10, and the source of the issue was likely triggered when watchOS updated between watchOS versions with your app already installed.

The complete set of issues is resolved with the watchOS 10.2 beta that is now available. Upgrading to watchOS 10.2 is the best path so you no longer encounter these issues.

If you remain on watchOS 9 as part of testing your app, you can remove and reinstall your app as a workaround. For any of your customers using your app on watchOS 9, you can provide an update to your app, as the process of installing the update will also correct the issue.

@edford  Just an update to provide some new context with the recent WatchOS 10.3 release etc...

I've done several updates to my app in the past few weeks and I still have issues from users running WatchOS 10.2/10.3 and WatchOS 9.6

For the WatchOS 9.6.3 users, I'm still seeing the exact same crashes as the one I submitted from September 23.

For the WatchOS 10 users, I only see crash reports for users on 10.0, however I still get problems reported from users mostly around complications disappearing from their watch face. This is even from users running WatchOS 10.2, too early to say for 10.3

Should I reopen a bug report / feedback on this or is there something I'm still missing to avoid all this?

Conditionally Migrate WatchOS 10 users ONLY to WidgetKit
 
 
Q