'dyld library not loaded- image not found' 是模拟器错误还是应用扩展错误?

is 'dyld library not loaded- image not found' an error in the simulator or an error in the app extension?

当我 运行 使用模拟器构建时,它崩溃并出现此错误,显示 'dyld: Library not loaded' 和 'image not found';

dyld: Library not loaded: @rpath/libswiftCore.dylib
   Referenced from:      /Users/username/Library/Developer/CoreSimulator/Devices/105F223C-3558-46E2-B3C0-CEF7E29B6B3D/data/Containers/Bundle/Application/D0F33E52-59FC-46EA-B1FF-DBE191CA4DD2/Watch.app/PlugIns/Watch Extension.appex/Watch Extension

这是模拟器错误,还是应用代码错误?我想知道我是否可以将应用程序上传到应用程序商店,或者它会因为这个错误而导致构建无效吗?

此外,关于如何修复它有什么想法吗?

您无法通过这种方式上传到 App Store,但我不知道您为什么要这样做,因为您无法测试您的应用程序。

转到您的主应用程序并尝试打开 Always Embed Swift Standard Libraries(这在早期版本中称为 Embedded Content Contains Swift)。

有时如果主应用程序目标没有任何 Swift 代码或者您有插件情况 Xcode 没有意识到它应该包含 Swift 标准库你的包。在这种情况下,无论出于何种原因,Xcode 认为 Watch.app 不需要 Swift 因此它不包含它,即使您的扩展程序确实使用 Swift.