控制台输出This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data.

升级xcode 8 以后在iOS 10运行程序出奔溃

控制台出现This app has crashed because it attempted to access privacy-sensitive data without a usage description.The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data.

描述的意思是需要在 info.plist 文件添加一个NSPhotoLibraryUsageDescription的 key,然后添加一个描述。

找到项目中info.plist文件,在其中添加

<key>NSBluetoothPeripheralUsageDescription</key>

<string>蓝牙权限</string>

<key>NSCameraUsageDescription</key>

<string>使用相机权限</string>

<key>NSMicrophoneUsageDescription</key>

<string>使用麦克风权限</string>

<key>NSPhotoLibraryUsageDescription</key>

<string>使用相册权限</string>

以上<key>注意不能写错,而<string>则为描述

这是利用Source Code形式打开的info.plist 文件,也可以使用info.plist 文件中的“+”进行添加key值。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容