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 版本)
相关推荐
瓜子三百克10 分钟前
Objective-C 路由表原理详解
开发语言·ios·objective-c
小蜜蜂嗡嗡1 小时前
flutter flutter_vlc_player播放视频设置循环播放失效、初始化后获取不到视频宽高
flutter
RyanGo3 小时前
iOS断点下载
ios·swift
孤鸿玉3 小时前
[Flutter小技巧] Row中widget高度自适应的几种方法
flutter
bawomingtian1233 小时前
FlutterView 源码解析
flutter
蒙小萌19933 小时前
找工作-iOS开发-3年经验-AI协作开发
ios
丶皮蛋菌5 小时前
关于OC与Swift内存管理的解惑
ios
杂雾无尘6 小时前
掌握生死时速:苹果应用加急审核全攻略!
ios·swift·apple
HarderCoder6 小时前
Swift 6.2 中的 `@concurrent`
ios·swift
Zender Han7 小时前
Flutter 进阶:实现带圆角的 CircularProgressIndicator
flutter