xcode 如何调查 iOS 崩溃并出现错误 NSOSStatusErrorDomain Code=-50“查询缺少类名”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33347839/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:06:58  来源:igfitidea点击:

How to investigate iOS crash with error NSOSStatusErrorDomain Code=-50 "query missing class name"

iosiphonexcode

提问by Blixt

Our app, released via TestFlight, is currently experiencing crashes for a small number of users, and the crash is very difficult to investigate. It happens on iOS 9 and 9.1, and we've seen it on several different iPhones. We've tested all these devices and OS versions so that doesn't appear to be the issue.

我们的应用程序是通过 TestFlight 发布的,目前有少数用户遇到崩溃,并且很难对崩溃进行调查。它发生在 iOS 9 和 9.1 上,我们已经在几款不同的 iPhone 上看到过。我们已经测试了所有这些设备和操作系统版本,因此这似乎不是问题。

To debug the issue I've tried to check the device logs, and here is all we get:

为了调试这个问题,我试图检查设备日志,这是我们得到的全部:

securityd[93] <Error>:  securityd_xpc_dictionary_handler Roger[1287] copy_matching Error Domain=NSOSStatusErrorDomain Code=-50 "query missing class name" UserInfo={NSDescription=query missing class name}
Roger[1287] <Error>:  SecOSStatusWith error:[-50] Error Domain=NSOSStatusErrorDomain Code=-50 "query missing class name" UserInfo={NSDescription=query missing class name}
SpringBoard[58] <Warning>: HW kbd: Failed to set (null) as keyboard focus
com.apple.xpc.launchd[1] (UIKitApplication:im.rgr.RogerApp[0x24fe][1287]) <Notice>: Service exited due to signal: Trace/BPT trap: 5
diagnosticd[84] <Error>: unable to find offset 0x99c5ba5c in shared cache for arch 'arm64'
SpringBoard[58] <Warning>: Application 'UIKitApplication:im.rgr.RogerApp[0x24fe]' crashed.
UserEventAgent[26] <Warning>: 2808550521498: id=im.rgr.RogerApp pid=1287, state=0

Once I try to run the app via Xcode with Debug or Production (exact same code as what was released) the error no longer happens. So it only seems to happen specifically when the app is released via TestFlight.

一旦我尝试通过 Xcode 和 Debug 或 Production(与发布的代码完全相同)运行应用程序,错误就不再发生。所以它似乎只有在通过 TestFlight 发布应用程序时才会发生。

Does anyone have any idea how to debug this issue?

有谁知道如何调试这个问题?

回答by Michael Baltaks

Just in case this helps, I saw this error in the logs when trying to open an app signed with an Enterprise provisioning profile. I did not see the usual warning about trying to open an untrusted app; I have no idea why.

为了以防万一,我在尝试打开使用企业配置文件签名的应用程序时在日志中看到了此错误。我没有看到有关尝试打开不受信任的应用程序的常见警告;我不知道为什么。

The fix was to go into Settings -> General -> Device Management (or Profiles & Device Management), and then under the Enterprise apps section, select the organisation and on the next screen choose to trust the profile. Documented in https://support.apple.com/en-us/HT204460

修复方法是进入设置 -> 常规 -> 设备管理(或配置文件和设备管理),然后在企业应用程序部分下,选择组织并在下一个屏幕上选择信任配置文件。记录在https://support.apple.com/en-us/HT204460

回答by Blixt

This issue turned out to be due to a framework accidentally being marked as required instead of optional, which would crash iOS 8 devices. (We originally thought it was happening on iOS 9+ devices as well, but it turned out it was iOS 8.4.)

这个问题原来是由于框架意外地被标记为必需而不是可选,这会导致 iOS 8 设备崩溃。(我们最初认为它也发生在 iOS 9+ 设备上,但结果是 iOS 8.4。)

Here's a screenshot of the corrected settings:

这是更正设置的屏幕截图: