WidgetKit Complication在iPhone与Apple Watch间同步异常求助
watchOS Complication组件在iPhone Watch应用中显示异常问题
我使用WidgetKit开发watchOS的Complication组件时,遇到了如下异常:
- 在iPhone的Watch应用中选择该组件时,组件无法显示内容,且组件库中显示为“未命名组件”
- 直接在Apple Watch上选择该组件则功能正常
该问题在真机和模拟器中均会出现,且仅在部分设备配对组合中发生:
- Apple Watch Ultra(watchOS 10.4)+ iPhone 14 Pro(iOS 17.0):异常
- Apple Watch Ultra(watchOS 10.4)+ iPhone 14 Pro(iOS 16.1):异常
- Apple Watch Ultra(watchOS 10.0)+ iPhone 14 Pro(iOS 17.0):正常
我创建了简化测试项目,问题依然存在。其中使用StaticConfiguration创建的Complication无此问题,但使用AppIntentConfiguration的Complication仍会触发该异常。相关代码如下:
var body: some WidgetConfiguration { AppIntentConfiguration(kind: kind, intent: ConfigurationAppIntent.self, provider: Provider()) { entry in WatchComplicationEntryView(entry: entry) .containerBackground(.fill.tertiary, for: .widget) } }
内容的提问来源于stack exchange,提问作者Kin Kaze
相关产品推荐
相关产品推荐

