Xcode iOS 11模拟器dyld:未找到符号:\ CKAccountChangedNotification

Xcode iOS 11模拟器dyld:未找到符号:\ CKAccountChangedNotification,xcode,ios-simulator,ios11,Xcode,Ios Simulator,Ios11,有人知道我的iOS 11模拟器发生了什么吗?当我在iOS 11上启动时,应用程序无法运行,并在控制台中显示: dyld: Symbol not found: _CKAccountChangedNotification Referenced from: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iO

有人知道我的iOS 11模拟器发生了什么吗?当我在iOS 11上启动时,应用程序无法运行,并在控制台中显示:

dyld: Symbol not found: _CKAccountChangedNotification

Referenced from: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreDuet.framework/CoreDuet

Expected in: /Users/steve/Library/Developer/Xcode/DerivedData/Cloud-bvzzwfgkjzfnzibxrwadbayiowcu/Build/Products/Debug-iphonesimulator/CloudKit.framework/CloudKit in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreDuet.framework/CoreDuet"

但在iOS 10模拟器或iOS 11设备上运行时,一切正常。我如何解决这个问题?提前谢谢

CloudKit是一个系统框架,因此您的框架会干扰其他试图在真实
CloudKit.framework中找到符号的系统框架

发生这种情况是因为模拟器当前未使用dyld共享缓存(否则符号将已解析为系统提供的
CloudKit.framework
)Xcode设置
DYLD_FRAMEWORK_路径
指向builded products目录,这样它就可以找到您的框架,即使它们没有打包到最终安装位置

当dyld尝试解析
\u CKAccountChangedNotification
时,这两个组合会导致dyld看到您的
CloudKit.framework版本


解决方案是重命名您的框架。

为什么在构建产品目录中有一个名为“CloudKit.framework”的框架?“CloudKit.framework”只是一个自定义框架,用于在主机应用程序及其扩展程序之间共享代码,“Cloud”是应用程序名。