ios14 - iOS 14 getAllVoiceShortcuts 返回 LaunchServices 错误
问题描述
在一个完全空白的 Xcode 项目中,我只需调用:
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
INVoiceShortcutCenter.shared.getAllVoiceShortcuts { (shortcuts, error) in
}
}
}
此日志失败:
[default] LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=271, _LSFunction=-[_LSDReadClient getServerStoreWithCompletionHandler:]}
这将重试 20 次,直到它放弃。
Siri 功能已添加到应用程序中。仅在 iOS 14 GM 和 Xcode 12 GM 中的物理设备上发生。任何帮助将非常感激。
解决方案
我有同样的问题(如你所说,仅在物理设备中),但我有 10 次重试,而不是 20 次。在 iOS 14.0 之前我没有错误,所以可能是 SiriKit 中的一些错误。我注意到这只会发生一次 - 当你下次调用它时,没有错误。所以,现在,我在 AppDelegate 中添加了这个调用 - 当应用程序启动时,因为错误会冻结 UI 一秒钟。
推荐阅读
- amazon-web-services - 是否有 AWS / Azure / Gcloud API 的包装器?
- python - 按 ID 分组并完成时间序列 Pandas
- javascript - 选择的js有问题
- react-native - 如何将 React Native 应用程序从 Windows 移动到 Mac 机器
- java - 不兼容的类型。在 android 中编辑文本错误
- java - 无法检查 json 空节点
- c++ - 有没有可能在迭代循环中有另一个迭代器的方法?
- scala - 在执行上下文中获得在后台运行的期货数量的最佳方法是什么?
- javascript - Reactjs:为什么 Carousel 根本没有显示?
- arrays - 循环数组上最大连续和的递归分治法