"UserNotificationsUI" 在为 UIKit 构建时不可用 Mac 错误

"UserNotificationsUI" is not available when building for UIKit for Mac error

"UserNotificationsUI" is not available when building for UIKit for
Mac. You may need to restrict the platforms for which this framework
should be linked in the target editor.

有人面临类似问题吗?

我使用的一个闭源第三方框架有 UserNotificationsUI 链接。

构建错误是因为 UIKitForMac 不支持移动特定框架,如 UserNotifications,这是正确的行为。

删除第三方依赖项为我解决了这个问题。