![](/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.