ios 10应用程序访问相机时崩溃 [英] ios 10 app crashes when accessing camera
问题描述
我是ios的新手.我正在构建一个需要摄像头访问权限的应用,根据新的要求,我已经在info.plist中添加了以下摄像头许可,但仍然出现以下异常.我还尝试清洁并重新安装手机上的应用程序.有谁知道如何解决这个问题.
I am new to ios. I am building an app which requires camera access, and according to new requirements I have already added following camera permission in info.plist but still I am getting following exception. I have also tried cleaning and reinstalling app on my phone. Does any one know how to fix this.
info.plit
info.plit
此应用已崩溃,因为它尝试访问对隐私敏感的应用没有使用说明的数据.应用程序的Info.plist必须包含NSCameraUsageDescription键,其字符串值向用户使用应用程序如何使用这些数据.
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.
推荐答案
您的隐私密钥值包含 $(PRODUCT_NAME),这似乎是导致此错误的原因(仅适用于iOS 10+)出现.
Your privacy key value contains $(PRODUCT_NAME), which appears to be the reason that this error (only for iOS 10+) appears.
将您的隐私密钥值更改为 pure 字符串,例如用于捕获具有照片效果的新图像",并且应该对其进行纠正.
Change your privacy key value to a pure string like "Used to capture new image for photo effect" and it should correct it.
这篇关于ios 10应用程序访问相机时崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!