NSKeyedUnarchiver _warnAboutNSObjectInAllowedClasses error:NSSecureCoding allowed classes list contains [NSObject class]

  1. Run my iOS App on a simulator, or real device
  2. Open the Console.app in MAC
  3. Force quit and relaunch the app
  4. Check the logs

I see this logs appearing as a "Fault", but I have no idea where it comes from, and I could NOT find any information from Apple as well. Could you provide more information on this error? Where should I start to debug it? What does it even mean? Is it a security thread to the app?

We have a huge enterprise app, there is no way that I would locate the issue with just these description, without any stacktrace. Could you please help?

FYI: There is NO crash or unexpected user behavior.

-[NSKeyedUnarchiver _warnAboutNSObjectInAllowedClasses]: NSSecureCoding allowed classes list contains [NSObject class], which bypasses security by allowing any Objective-C class to be implicitly decoded. Consider reducing the scope of allowed classes during decoding by listing only the classes you expect to decode, or a more specific base class than NSObject. This will be disallowed in the future.

I suspect that this is log noise caused by the system’s use of NSKeyedUnarchiver. However, let’s check to be sure…

We have a huge enterprise app, there is no way that I would locate the issue with just these description, without any stacktrace. Could you please help?

Try setting a symbolic breakpoint on -[NSKeyedUnarchiver _warnAboutNSObjectInAllowedClasses]. When you launch the app in step 3, do you stop at that breakpoint? If so, what does the backtrace look like?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Is this a private function defined in Apple?

Yes. Hence my symbolic breakpoint suggestion. Specifically:

  1. Choose View > Navigators > Breakpoints.

  2. Click the add (+) button at the bottom left and choose Symbolic Breakpoint.

  3. In the resulting breakpoint editor, paste -[NSKeyedUnarchiver _warnAboutNSObjectInAllowedClasses] into the Symbol field.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

NSKeyedUnarchiver _warnAboutNSObjectInAllowedClasses error:NSSecureCoding allowed classes list contains [NSObject class]
 
 
Q