'Cannot compile iOS app with Firebase because of deprecated NSKeyedArchiver archiveRootObject

I am updating a small application for iOS 12+. I updated the CocoaPod list to use the latest Firebase tools but I am unable to compile because GoogleDataTransport has a file that still references a deprecated method:

Line 129: [NSKeyedArchiver archiveRootObject:self toFile:[GDTCORStorage archivePath]];

It seems the pod is already up to date so I'm not sure how I'm supposed to get around this. Has anyone had the same problem?



Solution 1:[1]

Update to at least Xcode 10.1.

Recent versions of Firebase run into this issue with earlier versions of Xcode.

Solution 2:[2]

Here's the solution that worked for my case Xcode 12.5 version

  • clean derived data
  • re-open project
  • update the platform ios target to iOS 12 in a pod file
  • run pod install
  • re-launch your project

The reason for depricate errors is because firebase SDK set iOS 12 as the minimum target requirement, but in my pod file, I put iOS13.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Paul Beusterien
Solution 2 Muchicole