Search code examples
swiftxcodeios13xcode11

How to fix "objc[29072]: Class CLSUserDefaults is implemented in both" crash?


I updated my Xcode from 10.2 to 11. The project is compiling successfully, but when I run the project, it crashes. The log generates the following info:

objc[29072]: Class CLSUserDefaults is implemented in both /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) and /Users/anuranjanbose/Library/Developer/CoreSimulator/Devices/5EFF8F09-CBA0-491D-9E73-F8C75A0D4FE3/data/Containers/Bundle/Application/5E7E0F5F-EEFF-4252-9A40-14858F90EEE8/MyProject.app/MyProject (0x1026f3e60). One of the two will be used. Which one is undefined. libc++abi.dylib: terminating with uncaught exception of type NSException


Solution

  • If you are you using Crashlytics, update your Fabric and Crashlytics versions in your Pods as:

    pod 'Fabric’, '~> 1.10.2’
    pod 'Crashlytics’, '~> 3.14’
    

    And then pod install.