![](/img/trans.png)
[英]iOS 14 & XCode 12 beta 2 - Reading data from Firebase
[英]Xcode 12 beta and iOS 14: Weird console logs "objc[5551]: Class ... is implemented in both"
我刚刚下载了 Xcode 12 beta 2,现在我在运行我的应用程序时在控制台中收到了一堆奇怪的日志(使用 Xcode 11.5 时不会出现这些警告)。
它们如下所示:
objc[5551]: Class CSAudioFileManager is implemented in both
/Applications/Xcode-beta.app/Contents/Developer/Platforms/
iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/
Contents/Resources/RuntimeRoot/System/Library/
PrivateFrameworks/SpeakerRecognition.framework/SpeakerRecognition (0x1382890e0)
and
/Applications/Xcode-beta.app/Contents/Developer/Platforms/
iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/
Contents/Resources/RuntimeRoot/System/Library/
PrivateFrameworks/CoreSpeech.framework/CoreSpeech (0x13772c7a8).
One of the two will be used. Which one is undefined.
我正在为其他一些类(如CSVoiceIdXPCClient
、 CSNNVADEndpointAnalyzer
、 CSAudioRecordContext
、 CSOSTransaction
等)获取此类日志。 该应用程序使用 CoreData(与 CloudKit 结合)、FileManager 和 UserDefaults。 如果应用程序使用 Xcode 11.5 运行,则不会显示日志,并且对于大多数类,我很确定它们没有在我的代码中使用(至少我没有故意使用它们)。
请注意,日志仅在使用 iOS 14.0 运行模拟设备时出现。 例如,如果您选择 iPhone 11 Pro (13.5),则不会出现日志(仍然使用 Xcode 12)。
那么是否有解决此问题的方法,或者它只是当前 Xcode 12 测试版的错误,将在进一步的 Xcode 12 测试版发布期间删除?
编辑:
现在objc[5551]...
被替换为objc[6229]...
我有相同的日志(使用 Xcode Beta 3)。 我认为这可能与当前的 Xcode 12 beta 版本有关。
编辑:这些日志不再出现在我面前。 Xcode 12.0.1 (12A7300)
在我的情况下, CoreSpeech
和SpeakerRecognition
重复符号的问题在我意外删除~/Library/Developer/CoreSimulator/Caches
中的 dyld 模拟器缓存后开始出现。 可以通过以下方式恢复缓存:
xcrun simctl list -j runtimes
找到存在问题的运行时bundlePath
、 runtimeRoot
、 identifier
和buildversion
sw_vers -buildVersion
查找 MacOS 的构建版本$(bundlePath)/Contents/Resources
目录中,您将找到update_dyld_sim_shared_cache
可执行文件update_dyld_sim_shared_cache
。 将-root
选项指定为运行时 json runtimeRoot
中的 runtimeRoot。 将-cache_dir
指定为~/Library/Developer/CoreSimulator/Caches/dyld/$(mac_os_build_version)/$(identifier).$(buildversion)
。 如果您在 Big Sur 11.3 Beta、Xcode 12.4 和模拟器运行时 14.4 上运行命令,则组装的update_dyld_sim_shared_cache
调用将如下所示:
/Applications/Xcode12.4.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/update_dyld_sim_shared_cache -root /Applications/Xcode12.4.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot -cache_dir ~/Library/Developer/CoreSimulator/Caches/dyld/20E5196f/com.apple.CoreSimulator.SimRuntime.iOS-14-4.18D46
通过删除 Xcode 12.5.1 并重新安装它,我解决了这个问题。 我在这里看到myjunk的评论建议这样做,是的,它对我有用。
我还在这台机器上安装了 Xcode 13 beta 以及发布版本。 我在 Xcode 测试版上构建并运行了相同的项目,在 Xcode 12.5.1 上已经看到问题没有问题,然后更重要的是返回到 ZA3B5EBD8A1E9EBF44A172E80D5A7D3 问题仍然解决了。 重新安装 Xcode 12.5.1 可以解决问题,看起来您不必担心也使用测试版必然会导致它们返回......
您好,我将XCode升级到12.5后也出现过类似的情况,解决方法是:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.