Flutter IOS 真机 Widget 错误。Widget 安装后系统中没有

错误信息:

SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget 'com.xxx.xxx.ServerStatus' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0xd342b28b0 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (com.xxx.xxx.ServerStatus)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (com.xxx.xxx.ServerStatus)}}, FBSOpenApplicationRequestID=0xf89, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}." UserInfo={NSLocalizedDescription=Failed to show Widget 'com.xxx.xxx.ServerStatus' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0xd342b28b0 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (com.xxx.xxx.ServerStatus)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (com.xxx.xxx.ServerStatus)}}, FBSOpenApplicationRequestID=0xf89, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}., NSUnderlyingError=0xd342b3c30 {Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0xd342b28b0 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (com.xxx.xxx.ServerStatus)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (com.xxx.xxx.ServerStatus)}}, FBSOpenApplicationRequestID=0xf89, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}}} Domain: DTXMessage Code: 1 User Info: { DVTErrorCreationDateKey = "2025-04-22 00:09:56 +0000"; } -- SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget 'com.xxx.xxx.ServerStatus' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0xd342b28b0 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (com.xxx.xxx.ServerStatus)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (com.xxx.xxx.ServerStatus)}}, FBSOpenApplicationRequestID=0xf89, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}." UserInfo={NSLocalizedDescription=Failed to show Widget 'com.xxx.xxx.ServerStatus' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0xd342b28b0 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (com.xxx.xxx.ServerStatus)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (com.xxx.xxx.ServerStatus)}}, FBSOpenApplicationRequestID=0xf89, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}., NSUnderlyingError=0xd342b3c30 {Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0xd342b28b0 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (com.xxx.xxx.ServerStatus)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (com.xxx.xxx.ServerStatus)}}, FBSOpenApplicationRequestID=0xf89, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}}} Domain: DTXMessage Code: 1 -- System Information macOS Version 15.4.1 (Build 24E263) Xcode 16.3 (23785) (Build 16E140) Timestamp: 2025-04-22T08:09:56+08:00

一、 检查 Widget Extension 是否正确嵌入主应用

在 Xcode 中,选择主应用的 Target,导航到 "General" 标签页,确保在 "Frameworks, Libraries, and Embedded Content" 部分中,Widget Extension 被正确添加并设置为 "Embed Without Signing"。​

二、避免直接运行 Widget Extension

在 Xcode 中直接选择 Widget Extension 作为运行目标并在真机上运行, 可能会导致系统拒绝加载 Widget。

  1. 选择主应用作为运行目标。
  2. 运行主应用到真机。
  3. 在设备的主屏幕上,长按空白处,进入编辑模式,点击左上角的 "+" 按钮,添加你的 Widget。

三、确保 Widget Extension 的部署目标兼容设备

如果 Widget Extension 的部署目标(Deployment Target)高于真机的 iOS 版本,系统将无法加载 Widget。​请确保 Widget Extension 的部署目标设置为小于或等于设备的 iOS 版本。

四、我的调试过程。

  1. 我用模拟器调试 直接运行的 Widget Extension 一直没问题, 所以在真机上也做了同样的操作。但实际上真机不可以这样操作。
  2. 运行主应用,但在真机上找不到 Widget, 可以说是压根没有。 你需要在Widget Extension -> General 中调整你的 兼容最低的 IOS 开发版本,(必须小于或者等于你 真机的 ios 版本)
相关推荐
爱吃大芒果4 小时前
Flutter 主题与深色模式:全局样式统一与动态切换
开发语言·javascript·flutter·ecmascript·gitcode
小a杰.6 小时前
Flutter 进阶:构建高性能跨平台应用的实践与技巧
flutter
胖虎17 小时前
SwiftUI 页面作为一级页面数据被重置问题分析
ios·swiftui·swift·state·observedobject·stateobject·swiftui页面生命周期
巴拉巴拉~~10 小时前
Flutter 通用轮播图组件 BannerWidget:自动播放 + 指示器 + 全场景适配
windows·flutter·microsoft
ujainu小10 小时前
Flutter 结合 shared_preferences 2.5.4 实现本地轻量级数据存储
flutter
健了个平_2410 小时前
【iOS】如何在 iOS 26 的UITabBarController中使用自定义TabBar
ios·swift·wwdc
走在路上的菜鸟10 小时前
Android学Dart学习笔记第十六节 类-构造方法
android·笔记·学习·flutter
Digitally13 小时前
无需 iTunes 将文件从 PC 传输到 iPhone
ios·iphone
hh.h.14 小时前
Flutter适配鸿蒙轻量设备的资源节流方案
flutter·华为·harmonyos
巴拉巴拉~~14 小时前
Flutter 通用下拉刷新上拉加载列表 RefreshListWidget:分页 + 空态 + 错误处理
flutter