首页 > 解决方案 > ARSession 使用 Testflight 崩溃,而不是 Xcode

问题描述

我制作了一个使用后置摄像头跟踪 2D 身体运动数据的应用程序。我按照Apple 的示例从情节提要中创建了一个 ARView,并在我的 viewDidAppear 中添加了以下代码:

arView.session.delegate = self

// If the iOS device doesn't support body tracking, raise a developer error for
// this unhandled case.
guard ARBodyTrackingConfiguration.isSupported else {
    fatalError("This feature is only supported on devices with an A12 chip")
}

// Run a body tracking configration.
let configuration = ARBodyTrackingConfiguration()
arView.session.run(configuration)

当我打开应用程序时,从 Xcode 安装时一切正常,但从 TestFligth 安装时应用程序崩溃。崩溃日志向我显示了最后一个回溯日志arView.session.delegate = self

标签: iosswiftxcodearkit

解决方案


我找到了一种解决方法,以防有人遇到同样的问题。根据Apple的说法,这是 XCode 11 中的一个已知问题。要解决它,您需要手动将 RealityKit 添加到目标的 Link Binary with Libraries 构建阶段。希望这可以帮助


推荐阅读