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 版本)
相关推荐
开开心心loky21 小时前
[iOS] GCD - 线程与队列
macos·ios·objective-c·cocoa
00后程序员张1 天前
iOS 上架费用全解析 开发者账号、App 审核、工具使用与开心上架(Appuploader)免 Mac 成本优化指南
android·macos·ios·小程序·uni-app·cocoa·iphone
Bryce李小白1 天前
Flutter版本管理工具FVM
flutter
程序员老刘1 天前
Dart 3.7格式化工具“乱改代码”?强迫症必看
flutter·代码规范·dart
猫林老师1 天前
Flutter for HarmonyOS开发指南(二):混合开发架构与通信机制
flutter·架构·harmonyos
CheungChunChiu1 天前
从 Rust 到 Flutter:嵌入式图形与构建工具全景指南
开发语言·flutter·rust
旧时光_1 天前
第2章:第一个Flutter应用 —— 2.3 状态管理
flutter
fukai77221 天前
OmniFocus:专为 macOS 与 iOS 打造的专业级任务管理利器
macos·ios
行走的陀螺仪1 天前
Flutter 开发环境配置教程
android·前端·flutter·ios