为Mac生成UIKit时,“ UserNotificationsUI”不可用

时间:2019-06-06 11:05:00

标签: ios xcode macos push-notification uikitformac

  • 我的应用程序具有以下服务和内容扩展通知目标: 支持可按预期工作的Rich Remote Notifications iPad / iPhone iOS 13及以下版本
  • 我已经安装了Xcode 11-beta和macOS Catalina 10.15-beta
  • 在使用新的UIKitForMac进行构建时,出现以下错误-
"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.
  • 首先尝试在#if canImport() ... #endif无效的实例周围添加UserNotificationsUI
  • 然后删除了也无法使用的扩展目标。

有人遇到类似的问题吗?

Xcode11 screenshot

1 个答案:

答案 0 :(得分:0)

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

生成错误是因为UIKitForMac不支持特定于移动的特定框架(如UserNotifications)。

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