如何修复 "objc[29072]: Class CLSUserDefaults is implemented in both" 崩溃?
How to fix "objc[29072]: Class CLSUserDefaults is implemented in both" crash?
我将 Xcode 从 10.2 更新到 11。项目编译成功,但是当我 运行 项目时,它崩溃了。日志生成以下信息:
objc[29072]: Class CLSUserDefaults 在 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/ClassKit.framework/ClassKit ( 0x7fff87a74e58) 和 /Users/anuranjanbose/Library/Developer/CoreSimulator/Devices/5EFF8F09-CBA0-491D-9E73-F8C75A0D4FE3/data/Containers/Bundle/Application/5E7E0F5F-EEFF-4252-9A40-14858F90EEE8/MyProject.app/MyProject (0x1026f3e60)。将使用两者之一。哪一个是未定义的。
libc++abi.dylib:以 NSException
类型的未捕获异常终止
如果您正在使用 Crashlytics
,请将 Pods
中的 Fabric
和 Crashlytics
版本更新为:
pod 'Fabric’, '~> 1.10.2’
pod 'Crashlytics’, '~> 3.14’
然后pod install
。
我将 Xcode 从 10.2 更新到 11。项目编译成功,但是当我 运行 项目时,它崩溃了。日志生成以下信息:
objc[29072]: Class CLSUserDefaults 在 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/ClassKit.framework/ClassKit ( 0x7fff87a74e58) 和 /Users/anuranjanbose/Library/Developer/CoreSimulator/Devices/5EFF8F09-CBA0-491D-9E73-F8C75A0D4FE3/data/Containers/Bundle/Application/5E7E0F5F-EEFF-4252-9A40-14858F90EEE8/MyProject.app/MyProject (0x1026f3e60)。将使用两者之一。哪一个是未定义的。 libc++abi.dylib:以 NSException
类型的未捕获异常终止如果您正在使用 Crashlytics
,请将 Pods
中的 Fabric
和 Crashlytics
版本更新为:
pod 'Fabric’, '~> 1.10.2’
pod 'Crashlytics’, '~> 3.14’
然后pod install
。