简体   繁体   English

'NSKeyedUnarchiveFromData' 不应用于取消归档,并将在未来版本中删除

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

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 'bundleNamePlaceholder'[8424:100146] [general] 'NSKeyedUnarchiveFromData' 不应用于取消归档,并将在未来版本中删除

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我不清楚该消息,但我假设它可能与 CoreData object 或其内容有关

Is there a way to catch what's throwing this message or what might cause it?有没有办法捕捉抛出此消息的原因或可能导致此消息的原因?

apple is removing NSKeyedUnarchiveFromData at some point because it's not secure by default.苹果有时会删除NSKeyedUnarchiveFromData ,因为它默认不安全。 if you're storing a transformable value using NSKeyedUnarchiveFromData in coredata, it will then become unreadable.如果您在 coredata 中使用NSKeyedUnarchiveFromData存储可转换的值,那么它将变得不可读。

https://www.kairadiagne.com/2020/01/13/nssecurecoding-and-transformable-properties-in-core-data.html https://www.kairadiagne.com/2020/01/13/nssecurecoding-and-transformable-properties-in-core-data.html

and https://developer.apple.com/forums/thread/107533https://developer.apple.com/forums/thread/107533

To find out what is causing these log messages, try adding symbolic break points for要找出导致这些日志消息的原因,请尝试为

+[NSKeyedUnarchiver unarchiveObjectWithData:] , +[NSKeyedUnarchiver unarchiveObjectWithData:] ,

+[NSKeyedUnarchiver unarchiveTopLevelObjectWithData:error:] , and +[NSKeyedUnarchiver unarchiveTopLevelObjectWithData:error:]

+[NSKeyedUnarchiver unarchiveObjectWithFile:]

This helped me help finding the culprit.这帮助我找到了罪魁祸首。

In my case problem was in using Transformable type in CoreData for saving array of strings.在我的情况下,问题是在 CoreData 中使用Transformable类型来保存字符串数组。 By default CoreData uses NSKeyedUnarchiver instead of NSSecureUnarchiveFromData transformer.默认情况下,CoreData 使用NSKeyedUnarchiver而不是NSSecureUnarchiveFromData转换器。 So changing transformer solved this problem.所以更换变压器解决了这个问题。

在此处输入图像描述

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.通常这与核心数据可转换属性有关,但在我的情况下,这也是由外部库引起的,该库使用NSValueTransformer.valueTransformerNames迭代运行时可用的所有值转换器类。 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.因此,如果您找不到拥有此日志的原因,您可能还想在代码中搜索NSValueTransformer并检查某处是否没有类似的问题。

For me the issue was from GoogleAnalytics framework, thanks to @Lutz I could figure it out.对我来说,问题来自 GoogleAnalytics 框架,多亏了@Lutz,我才能弄清楚。 For those facing issue from GA please use the updated sdk, this issue seem to be resolved GA SDK对于那些面临 GA 问题的人,请使用更新的 sdk,这个问题似乎已解决GA SDK

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何修复“NSKeyedUnarchiveFromData”不应该用于取消归档并将在未来版本中删除的错误? - How to fix the ''NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release' error? 试图理解此警告:[UITabBarItem]! 使用“!” 这里已弃用,并将在以后的版本中删除 - Trying to understand this warning:[UITabBarItem]! Using '!' here is deprecated and will be removed in a future release 可转换和 NSKeyedUnarchiveFromData - Transformable and NSKeyedUnarchiveFromData 存档CocoaPods依赖项以发布到App Store时出错 - Error archiving a CocoaPods dependency for release to App Store 在存档iOS中的发行版本之前,有什么方法可以自动运行我的所有单元测试 - Is there any way to auto run all my Unit Tests before archiving release build in iOS 是否应该在 iOS 中使用 removeObserver(self) 删除通知? - Should notifications be removed using removeObserver(self) in iOS? Objective-c class 通过桥接暴露 header 从 Z818056DBD7E201248206B9CCD8 - Objective-c class exposed via bridging header not visible from swift when archiving release Xcode 7.3归档结束,但使Xcode崩溃,并出现以下错误:bundleIdentifier应该是一个非空字符串,但它是一个空字符串 - Xcode 7.3 archiving ends but crashes Xcode with error : bundleIdentifier should be a non-empty string, but it's an empty string 应该使用谁的见证表? - Whose witness table should be used? 不建议使用'init(nilLiteral :)':请改用JSON.null。 在将来的版本中将被删除 - 'init(nilLiteral:)' is deprecated: use JSON.null instead. Will be removed in future versions
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM