ios - "UserNotificationsUI"在构建 UIKit for Mac 错误时不可用

标签 ios xcode macos push-notification uikitformac

  • 我的应用有服务和内容扩展通知目标 支持按预期工作的丰富的远程通知 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.
  • 首先尝试在 UserNotificationsUI 实例周围添加 #if canImport() ... #endif,但没有成功
  • 然后删除了同样不起作用的扩展目标。

有人遇到类似的问题吗?

Xcode11 screenshot

最佳答案

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

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

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

关于ios - "UserNotificationsUI"在构建 UIKit for Mac 错误时不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56476286/

相关文章:

ios - 按数字对字典数组进行排序

iphone - Xamarin iTunes 附属链接

Xcode:如何从 shell 脚本中找到 $PRODUCT_NAME?

macos - 捆绑到 Cocoa 应用程序中的 Git 无法在 bundle 中找到帮助程序

iOS TestFlight 构建与 CocoaPods 崩溃

ios - 水平方向自动移动 UICollectionCells

ios - SecKeyCreateSignature 使用 privateKey 提供错误访问权限

xcode - 使弹出窗口在 iOS 5.0 和 iOS 5.1 中看起来相同

OS X 上的 HTTP 通信监控

macos - 如何在不增加尺寸的情况下修剪 eps 或 pdf