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 版本)
相关推荐
RaidenLiu2 小时前
RepaintBoundary是什么?怎么用?
flutter
白玉cfc2 小时前
【iOS】网易云仿写
ui·ios·objective-c
淹没4 小时前
🚀 告别复杂的HTTP模拟!HttpHook让Dart应用测试变得超简单
android·flutter·dart
归辞...4 小时前
「iOS」——内存五大分区
macos·ios·cocoa
HX4365 小时前
MP - List (not just list)
android·ios·全栈
吴Wu涛涛涛涛涛Tao9 小时前
Flutter 个人主页实践笔记
flutter
忆江南9 小时前
NSProxy是啥,用来干嘛的
ios
忆江南9 小时前
dyld
ios
愿天深海9 小时前
Flutter 提取图像主色调 ColorScheme.fromImageProvider
android·前端·flutter