gpt4 book ai didi

swift - "Session Failed - probably due to lack of camera access"Xcode错误

转载 作者:行者123 更新时间:2023-11-28 05:46:20 24 4
gpt4 key购买 nike

我遵循了本教程:https://www.raywenderlich.com/378-augmented-reality-and-arkit-tutorial了解增强现实。

当我运行项目时出现错误:

 Session did fail with error: Error Domain=com.apple.arkit.error Code=100 "Unsupported configuration." UserInfo={NSLocalizedDescription=Unsupported configuration., NSLocalizedFailureReason=The provided configuration is not supported on this device.} Session Failed - probably due to lack of camera access.   

即使我使用以下代码进行测试以验证模拟器是否支持 ARKit,我也没有找到此错误的原因:

 if (ARConfiguration.isSupported) {
print("ARKit is supported. You can work with ARKit")
} else {
print("ARKit is not supported. You cannot work with ARKit")
}

可能是什么问题?

最佳答案

if ARConfiguration.isSupported {
print("ARKit is supported. You can work with ARKit")
} else {
print("ARKit is not supported. You cannot work with ARKit")
}

这个 ARConfiguration.isSupported 实际上并没有表明你运行你的应用程序的设备(或模拟器)是否能够使用世界跟踪或类似的东西(这是很多 AR 所必需的)特征)。

您可能想检查一下 ARConfiguration支持子类...例如这个 ARWorldTrackingConfiguration

if ARWorldTrackingConfiguration.isSupported { ... }

无论如何,这并不能解决出现错误的问题,如果您想测试您的 AR 应用,您必须在真实设备上运行您的应用。

关于swift - "Session Failed - probably due to lack of camera access"Xcode错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54634480/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com