Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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).
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. The app uses CoreData (in combination with CloudKit), FileManager and 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).
Note that the logs just appear when running a simulated device with iOS 14.0. If you choose iPhone 11 Pro (13.5) for example, then the logs don't appear (still with 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?

EDIT:
Now objc[5551]... is replaced with objc[6229]...

like image 385
finebel Avatar asked Jul 18 '20 16:07

finebel


2 Answers

I'm having the same logs (Using Xcode Beta 3). I think it might be something with current Xcode 12 beta version.

Edit: Those logs are not appearing anymore to me. Xcode 12.0.1 (12A7300)

like image 131
Bruno Delgado Avatar answered Nov 18 '22 11:11

Bruno Delgado


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. The cache can be restored in the following way:

  1. Locate the runtime where the issue is present using xcrun simctl list -j runtimes
  2. In the json object for the runtime you will hopefully find bundlePath, runtimeRoot, identifier and buildversion
  3. Lookup the build version for your MacOS using sw_vers -buildVersion
  4. In the $(bundlePath)/Contents/Resources directory you will find the update_dyld_sim_shared_cache executable
  5. Call the update_dyld_sim_shared_cache. Specify the -root option as the runtimeRoot from the runtime json object. Specify the -cache_dir as ~/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:

/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
like image 4
Timofey Solonin Avatar answered Nov 18 '22 11:11

Timofey Solonin