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.
When applied .contentMarginsDisabled() modifier to WidgetConfiguration, Widget extension crashes on launch in Xcode 15 Beta 3.
struct TestWidget: Widget {
let kind: String = "TestWidget"
var body: some WidgetConfiguration {
return IntentConfiguration(kind: kind,
intent: TestIntent.self,
provider: TestProvider()) { entry in
TestView(entry: entry)
}
.configurationDisplayName("TestWidget")
.description("This is TestWidget.")
.supportedFamilies([.systemMedium])
.contentMarginsDisabled() // << Here
}
}
Though it works in Xcode 15 Beta 2. Anyone facing same issue ?
Post not yet marked as solved
Is there an option to disable widgets for Smart Stack only?
Post not yet marked as solved
I updated my project from watch app + extension to single-execute project with Xcode 15.
Then add a widget target to watch app.
The new WidgetKit swiftUI complications works well on simulator, but not shown on the real device.(can not find on Apple Watch Face Complication Editor or rectangle widget)
I tried:
clean xcode build && Derived Data.
reboot my watch/iphone
delete all old clockkit complication settings & complicationcontroller.swift
the watch still show old clockkit complicaton , that very buggy. so I try next:
4. restore my watch and pair it again.
The new WidgetKit complication still not shown, it very frustrated.
Do I have to change my old watch app to swiftUI lifecycle project to work?
But code is works onthe simulator, which doesn't make sense.
when I debug widget extension on Xcode, it show error:
SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget 'hltek.***.watchkitapp.ComplicationWidget' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.Carousel" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (IOSSHLMainWorkspace) for reason: BadArgument., NSLocalizedDescription=The request to open "com.apple.Carousel" failed., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x15687310 {Error Domain=FBSOpenApplicationErrorDomain Code=2 "(null)" UserInfo={NSUnderlyingError=0x15696b00 {Error Domain=com.apple.Carousel.ComplicationExtensionDebuggingErrorDomain Code=3 "No widgets available to reload" UserInfo={NSLocalizedFailureReason=No widgets available to reload}}}}, FBSOpenApplicationRequestID=0x16e7}." UserInfo={NSUnderlyingError=0x15684f10 {Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.Carousel" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (IOSSHLMainWorkspace) for reason: BadArgument., NSLocalizedDescription=The request to open "com.apple.Carousel" failed., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x15687310 {Error Domain=FBSOpenApplicationErrorDomain Code=2 "(null)" UserInfo={NSUnderlyingError=0x15696b00 {Error Domain=com.apple.Carousel.ComplicationExtensionDebuggingErrorDomain Code=3 "No widgets available to reload" UserInfo=0x1567e360 (not displayed)}}}, FBSOpenApplicationRequestID=0x16e7}}, NSLocalizedDescription=Failed to show Widget 'hltek.***.watchkitapp.ComplicationWidget' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.Carousel" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (IOSSHLMainWorkspace) for reason: BadArgument., NSLocalizedDescription=The request to open "com.apple.Carousel" failed., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x15687310 {Error Domain=FBSOpenApplicationErrorDomain Code=2 "(null)" UserInfo={NSUnderlyingError=0x15696b00 {Error Domain=com.apple.Carousel.ComplicationExtensionDebuggingErrorDomain Code=3 "No widgets available to reload" UserInfo={NSLocalizedFailureReason=No widgets available to reload}}}}, FBSOpenApplicationRequestID=0x16e7}.}
Domain: DTXMessage
Code: 1
User Info: {
DVTErrorCreationDateKey = "2023-07-06 03:36:45 +0000";
}
--
System Information
macOS Version 13.4.1 (Build 22F2083)
Xcode 15.0 (22221.2) (Build 15A5195k)
Timestamp: 2023-07-06T11:36:45+08:00
dyld[459]: Symbol not found: _$s21DeveloperToolsSupport15PreviewRegistryPAAE7previewAA0D0VvgZ
Referenced from: <E835EDE1-190A-33B0-9462-EFD25999365D> /private/var/containers/Bundle/Application/F2DE6431-DF97-472D-934F-B2B3F76E660E/*** WatchKit App.app/PlugIns/ComplicationWidgetExtension.appex/ComplicationWidgetExtension
Expected in: <E4C8E0EA-CF6C-381C-877C-716427DD3DFB> /System/Library/Frameworks/DeveloperToolsSupport.framework/DeveloperToolsSupport
debug the extension on simulator with no error.
There is only some document attached in the session website now.