'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release

Viewed 18652

I'm receiving a message in the log saying

'bundleNamePlaceholder'[8424:100146] [general] 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release

The message is not clear to me but I'm assuming that it might be something related to a CoreData object or maybe its content

Is there a way to catch what's throwing this message or what might cause it?

5 Answers

In my case the problem was in using Transformable type in CoreData for saving array of strings. By default CoreData uses NSKeyedUnarchiver instead of NSSecureUnarchiveFromData transformer. So changing the transformer solved this problem.

enter image description here

To find out what is causing these log messages, try adding symbolic break points for

+[NSKeyedUnarchiver unarchiveObjectWithData:],

+[NSKeyedUnarchiver unarchiveTopLevelObjectWithData:error:], and

+[NSKeyedUnarchiver unarchiveObjectWithFile:]

This helped me finding the culprit.

Usually this is related to Core Data Transformable attributes however in my case this was also caused by an external library which was using NSValueTransformer.valueTransformerNames to iterate over all value transformer classes available in runtime. This was also causing the same errors in logs and symbolic breakpoints given in other answer here did not catch them. So if you cannot find a reason why you have this logs you might also want to search for NSValueTransformer in your code and check if there isn't a similar problem somewhere.

For me the issue was from GoogleAnalytics framework, thanks to @Lutz I could figure it out. For those facing issue from GA please use the updated sdk, this issue seem to be resolved GA SDK

Related