在 watchOS 5.2 崩溃时找不到适合 Combine 的图像

No suitable image for Combine found on watchOS 5.2 crash

信息

我的应用程序在 Apple Watches 运行 watchOS 4 & 5 上崩溃。一些新功能(即 Combine)取决于 watchOS 6,这些方法的使用明确标有

@available(watchOSApplicationExtension 6.0.0, *)

该应用程序是用 Xcode 9/10 创建的(我忘了具体是哪个),目标是 watchOS 4。现在当它用 Xcode 11 构建时,并且有依赖于 Combine 的文件,它在 watchOS 5 Apple Watch 上崩溃。

错误是

dyld: Library not loaded: /System/Library/Frameworks/Combine.framework/Combine
  Referenced from: /private/var/containers/Bundle/Application/7A361FAB-EBE7-483D-BFD7-E915F15B5B14/Chirp WatchKit App.app/PlugIns/Chirp WatchKit Extension.appex/Chirp WatchKit Extension
  Reason: image not found

很明显,Combine 表现不佳。

此外,它不会在 watchOS 5 模拟器中启动,并且错误更能说明问题:

dyld: Library not loaded: /System/Library/Frameworks/Combine.framework/Combine
  Referenced from: /Users/willbishop/Library/Developer/CoreSimulator/Devices/C6F36860-E70A-45E6-AC3B-E54DBCEA7C7A/data/Containers/Bundle/Application/1B2EC7C4-731F-4EC1-B23F-09A0B49CD055/Chirp WatchKit App.app/PlugIns/Chirp WatchKit Extension.appex/Chirp WatchKit Extension
  Reason: no suitable image found.  Did find:
    /System/Library/Frameworks/Combine.framework/Combine: mach-o, but wrong architecture

我尝试过的:

尽管如此,还是没有运气。我假设它是某处的构建设置,但我不知道是哪一个。

我相信您需要做的是使 Combine.framework 有选择地链接。出于某种原因,Combine 不能为此使用正常的 UI(还?),但似乎在 another thread.

中有一个解决方案