简体   繁体   English

Xcode 12 beta 和 iOS 14:奇怪的控制台日志“objc [5551]:Class ...在两者中都实现了”

[英]Xcode 12 beta and iOS 14: Weird console logs "objc[5551]: Class ... is implemented in both"

I have just downloaded Xcode 12 beta 2 and now I'm getting a bunch of weird logs in the console while I'm running my app (these warnings don't appear when using Xcode 11.5).我刚刚下载了 Xcode 12 beta 2,现在我在运行我的应用程序时在控制台中收到了一堆奇怪的日志(使用 Xcode 11.5 时不会出现这些警告)。
They look like the following one:它们如下所示:

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.

These kind of logs I'm getting for some other classes like ( CSVoiceIdXPCClient , CSNNVADEndpointAnalyzer , CSAudioRecordContext , CSOSTransaction , etc.), too.我正在为其他一些类(如CSVoiceIdXPCClientCSNNVADEndpointAnalyzerCSAudioRecordContextCSOSTransaction等)获取此类日志。 The app uses CoreData (in combination with CloudKit), FileManager and UserDefaults.该应用程序使用 CoreData(与 CloudKit 结合)、FileManager 和 UserDefaults。 If the app runs with Xcode 11.5, the logs aren't shown and for the most of the classes I'm pretty sure, that they aren't used in my code (at least I don't use them intentionally).如果应用程序使用 Xcode 11.5 运行,则不会显示日志,并且对于大多数类,我很确定它们没有在我的代码中使用(至少我没有故意使用它们)。
Note that the logs just appear when running a simulated device with iOS 14.0.请注意,日志仅在使用 iOS 14.0 运行模拟设备时出现。 If you choose iPhone 11 Pro (13.5) for example, then the logs don't appear (still with Xcode 12).例如,如果您选择 iPhone 11 Pro (13.5),则不会出现日志(仍然使用 Xcode 12)。

So is there a fix for this problem or is it just an error of the current Xcode 12 beta version which will be removed during the release of further Xcode 12 beta versions?那么是否有解决此问题的方法,或者它只是当前 Xcode 12 测试版的错误,将在进一步的 Xcode 12 测试版发布期间删除?

EDIT:编辑:
Now objc[5551]... is replaced with objc[6229]...现在objc[5551]...被替换为objc[6229]...

I'm having the same logs (Using Xcode Beta 3).我有相同的日志(使用 Xcode Beta 3)。 I think it might be something with current Xcode 12 beta version.我认为这可能与当前的 Xcode 12 beta 版本有关。

Edit: Those logs are not appearing anymore to me.编辑:这些日志不再出现在我面前。 Xcode 12.0.1 (12A7300) Xcode 12.0.1 (12A7300)

In my case the issue with CoreSpeech and SpeakerRecognition duplicate symbols started appearing after I accidentally deleted the dyld simulator cache in ~/Library/Developer/CoreSimulator/Caches .在我的情况下, CoreSpeechSpeakerRecognition重复符号的问题在我意外删除~/Library/Developer/CoreSimulator/Caches中的 dyld 模拟器缓存后开始出现。 The cache can be restored in the following way:可以通过以下方式恢复缓存:

  1. Locate the runtime where the issue is present using xcrun simctl list -j runtimes使用xcrun simctl list -j runtimes找到存在问题的运行时
  2. In the json object for the runtime you will hopefully find bundlePath , runtimeRoot , identifier and buildversion在运行时的 json object 中,您有望找到bundlePathruntimeRootidentifierbuildversion
  3. Lookup the build version for your MacOS using sw_vers -buildVersion使用sw_vers -buildVersion查找 MacOS 的构建版本
  4. In the $(bundlePath)/Contents/Resources directory you will find the update_dyld_sim_shared_cache executable$(bundlePath)/Contents/Resources目录中,您将找到update_dyld_sim_shared_cache可执行文件
  5. Call the update_dyld_sim_shared_cache .调用update_dyld_sim_shared_cache Specify the -root option as the runtimeRoot from the runtime json object.-root选项指定为运行时 json runtimeRoot中的 runtimeRoot。 Specify the -cache_dir as ~/Library/Developer/CoreSimulator/Caches/dyld/$(mac_os_build_version)/$(identifier).$(buildversion) .-cache_dir指定为~/Library/Developer/CoreSimulator/Caches/dyld/$(mac_os_build_version)/$(identifier).$(buildversion)

If you are running the command on Big Sur 11.3 Beta, Xcode 12.4 and simulator runtime 14.4, the assembled update_dyld_sim_shared_cache call will look like this:如果您在 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

This problem was solved for me by deleting Xcode 12.5.1 and re-installing it.通过删除 Xcode 12.5.1 并重新安装它,我解决了这个问题。 I see a comment here from myjunk recommending that and yes, it work for me.我在这里看到myjunk的评论建议这样做,是的,它对我有用。

I also have the Xcode 13 beta installed on this machine alongside the release version.我还在这台机器上安装了 Xcode 13 beta 以及发布版本。 I built and ran the same project on the Xcode beta where the issues had been seen on Xcode 12.5.1 without problems, and then more importantly returning to Xcode 12.5.1 the problem was still solved .我在 Xcode 测试版上构建并运行了相同的项目,在 Xcode 12.5.1 上已经看到问题没有问题,然后更重要的是返回到 ZA3B5EBD8A1E9EBF44A172E80D5A7D3 问题仍然解决了。 Reinstalling Xcode 12.5.1 did the trick, and it looks like you don't have to worry that also using the beta will necessarily cause them to return...重新安装 Xcode 12.5.1 可以解决问题,看起来您不必担心也使用测试版必然会导致它们返回......

Hello I have also had a similar case after I upgraded XCode to 12.5, the way to solve it is:您好,我将XCode升级到12.5后也出现过类似的情况,解决方法是:

  1. Close XCode and Simulator if on the running如果正在运行,则关闭 XCode 和 Simulator
  2. Remove ~/Library/Developer/CoreSimulator/Caches删除 ~/Library/Developer/CoreSimulator/Caches
  3. Remove ~/Library/Developer/CoreSimulator/Devices删除 ~/Library/Developer/CoreSimulator/Devices
  4. Open XCode, choose your scheme and build project.打开 XCode,选择您的方案并构建项目。
  5. If you find duplicate simulator when choose simulator, you can delete any of the simulators you don't want to use.如果您在选择模拟器时发现重复的模拟器,您可以删除任何您不想使用的模拟器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM