我刚刚下载了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 beta版本的错误,在发布进一步的Xcode 12 beta版本时将被删除?
编辑:
现在objc[5551]...
被objc[6229]...
所取代
发布于 2020-07-28 13:24:20
我有相同的日志(使用Xcode Beta 3)。我认为这可能与当前的Xcode 12测试版有关。
编辑:那些日志不再出现在我面前了。Xcode 12.0.1 (12A7300)
发布于 2021-03-20 19:24:33
在我的例子中,CoreSpeech
和SpeakerRecognition
重复符号的问题开始出现,因为我意外地删除了~/Library/Developer/CoreSimulator/Caches
中的dyld模拟器缓存。缓存可以通过以下方式还原:
使用xcrun simctl list -j runtimes
bundlePath
、runtimeRoot
、identifier
和buildversion
sw_vers -buildVersion
$(bundlePath)/Contents/Resources
目录为MacOS找到构建版本--您将找到update_dyld_sim_shared_cache
executable
update_dyld_sim_shared_cache
。将-root
选项指定为运行时json对象中的runtimeRoot
。将~/Library/Developer/CoreSimulator/Caches/dyld/$(mac_os_build_version)/$(identifier).$(buildversion)
.指定为-cache_dir
如果在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
发布于 2021-08-18 03:39:43
这个问题是通过删除Xcode 12.5.1并重新安装来解决的。我在这里看到myjunk的一条评论,建议这样做,是的,它对我有用。
我还在这台机器上安装了Xcode 13测试版和发行版。我在Xcode测试版上构建并运行了相同的项目,在Xcode 12.5.1上看到了这些问题,没有问题,更重要的是,回到Xcode 12.5.1问题仍然得到解决。重新安装Xcode 12.5.1成功了,看起来您不必担心也会使用测试版一定会导致它们返回.
https://stackoverflow.com/questions/62970821
复制相似问题