ClockKit to WidgetKit migration bug

Hi, I'm migrating ClockKit complications to WidgetKit. Everything works well except when I run the WidgetKit version, I see complications appear twice each in the complications list for my app when adding them.

If I restart the app from Xcode, it won't happen again, only for the first time. But on the actual device, only Watch restart or app reinstall fixes it which is frustrating and would not be ideal for live users.

I even tried Apple's example ClockKit project -> added complications to watch face -> added WidgetKit target, CLKComplicationWidgetMigrator and func widgetConfiguration(from complicationDescriptor: CLKComplicationDescriptor) code -> run the app -> new complications appear correctly replacing old ones -> when hold to add/change complications I see it doubled (screenshot attached) and it's even selected twice

If I add more complications, they will appear two times as well except one selected in two places almost like it's two same lists created.

class ComplicationController: NSObject, CLKComplicationDataSource, CLKComplicationWidgetMigrator {

    @available(watchOSApplicationExtension 9.0, *)
    var widgetMigrator: CLKComplicationWidgetMigrator {
        self
    }

    @available(watchOSApplicationExtension 9.0, *)
    func widgetConfiguration(from complicationDescriptor: CLKComplicationDescriptor) async -> CLKComplicationWidgetMigrationConfiguration? {

        switch complicationDescriptor.identifier {
        case "Coffee_Tracker_Caffeine_Dose":
            return CLKComplicationStaticWidgetMigrationConfiguration(
                kind: "WidgetKitComplications",
                extensionBundleIdentifier: "com.example.apple-samplecode.Coffee-Tracker.watchkitapp.watchkitextension.WidgetKitComplications")

        default:
            return nil
        }
    }
Answered by Engineer in 802525022

Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. I'd greatly appreciate it if you could open a bug report, include sample project and sysdiagnose, and post the FB number here once you do. Bug Reporting: How and Why? has tips on creating your bug report.

Rico

WWDR - DTS - Software Engineer

Hey there! This sounds like something out of your App/Complication's control. It would be best to file a Feedback reporting this bug.

Accepted Answer

Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. I'd greatly appreciate it if you could open a bug report, include sample project and sysdiagnose, and post the FB number here once you do. Bug Reporting: How and Why? has tips on creating your bug report.

Rico

WWDR - DTS - Software Engineer

Submitted as FB15119761

Pretty sure this is the same thing I first mentioned here 15 months ago 😕

https://developer.apple.com/forums/thread/732751

ClockKit to WidgetKit migration bug
 
 
Q