Error on launch of app. First seen in iOS 15. What is this?

here is the warning I am seeing from the Xcode console:

-[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSString' (0x1dbbcb6e8) [/System/Library/Frameworks/Foundation.framework]' for key 'NS.keys', even though it was not explicitly included in the client allowed classes set: '{(

    "'NSDate' (0x1dbbc0ac0) [/System/Library/Frameworks/CoreFoundation.framework]",

    "'NSDictionary' (0x1dbbc0c28) [/System/Library/Frameworks/CoreFoundation.framework]"

)}'. This will be disallowed in the future.

Answered by concern12345 in 696008022

Ok. looks like the problem originally stemmed from FirebaseFirestoreSwift. Google had changed from using 0.x for beta versions, and instead used 7.0-beta to indicate beta. I was not able to update FirebaseFirestoreSwift, which prevented my updating the other google pods, like firebase. the fix is pod 'FirebaseFirestoreSwift', '~> 7.0-beta'. then do pod update

Are you using NSKeyedUnarchiver explicitly somewhere in your code? If so, you should better update your code to prepare This will be disallowed in the future. It may be used somewhere in the runtime of iOS, in such cases, you may need to ignore the warning.

USing firebase? Try to remove the firebase init code and recheck.

First of all NSKeyedUnarchiver should be allocated and initialized like this (objective-c):

NSError* err;

NSKeyedUnarchiver* unarchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:someData error:&err];

It looks like you use NSSecure coding. Therefore you have to specify classes on decoding objects. In your case it looks something like this like this

NSDictionary* someDict = [unarchiver decodeObjectOfClass:[NSDictionary class] forKey:NSKeyedArchiveRootObjectKey];

But the NSDictionary contained additional strings. That was the cause of the log message. By adding NSString to the decoded class list the error is gone.

NSDictionary* someDict = [unarchiver decodeObjectOfClasses:[[NSSet alloc] initWithArray:@[[NSDictionary class],[NSString class]]] forKey:NSKeyedArchiveRootObjectKey]

This is a copy from my answer here: https://stackoverflow.com/questions/70050018/error-general-nskeyedunarchiver-validateallowedclassforkey-allowed-u

Edit: It's well known that there was an old version of firebase/crashlytics (around 2016) that had this bug, so updating should just be it.

Accepted Answer

Ok. looks like the problem originally stemmed from FirebaseFirestoreSwift. Google had changed from using 0.x for beta versions, and instead used 7.0-beta to indicate beta. I was not able to update FirebaseFirestoreSwift, which prevented my updating the other google pods, like firebase. the fix is pod 'FirebaseFirestoreSwift', '~> 7.0-beta'. then do pod update

Error on launch of app. First seen in iOS 15. What is this?
 
 
Q