ios NSExtension -运行时警告- [NSXPCDecoder验证允许的类:对于密钥:]

mutmk8jj  于 2023-01-27  发布在  iOS
关注(0)|答案(2)|浏览(442)

我正在使用共享扩展,收到以下运行时警告:
注意:即使在新项目上添加共享扩展并运行,也会抛出相同的运行时警告

[Foundation] *** -[NSXPCDecoder validateAllowedClass:forKey:]: 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 become an error in the future. Allowed class list: {(
    "'NSObject' (0x7fff862bc6e8) [/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib]"
)}

下面给出的是扩展模块的信息列表

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>NSExtension</key>
    <dict>
        <key>NSExtensionAttributes</key>
        <dict>
            <key>NSExtensionActivationRule</key>
            <dict>
                <key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
                <integer>1</integer>
            </dict>
        </dict>
        <key>NSExtensionMainStoryboard</key>
        <string>MainInterface</string>
        <key>NSExtensionPointIdentifier</key>
        <string>com.apple.share-services</string>
    </dict>
</dict>
</plist>

问题:

  • 我应该怎么做才能修复此警告?
nqwrtyyt

nqwrtyyt1#

结论:

  • 我得到了苹果的官方确认,这是他们在使用共享功能时的一个错误
  • 我已经提交了一个错误报告,并告诉他们关于反馈ID。
  • 我被告知,只要我没有看到我的应用程序有任何问题,我就可以忽略这个错误。

备注:

作为新的操作系统,Xcode已经发布,最好提出一个bug并与Apple DTS进行检查以确认这一点

8zzbczxx

8zzbczxx2#

只需在IOS16.1和Xcode 14上遇到这个问题。
如果这仍然是一个bug,有谁能证实这一点吗?有什么方法可以抑制警告?

相关问题