问题描述
今天创建一个demo,使用iPhone的相机扫描二维码,在building成功后,运行到手机上,app崩溃,log为
The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.
原因
在app访问相机时需要给用户一个提示,要用相机了,请求用户允许。
解决方法
点击info.plist文件,在information Property List下新增加一个itemPrivacy - Camera Usage Description
,Value的值是显示在手机屏幕上,给用户看的。具体如下图所示