控制台输出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 exp

升级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文件,在其中添加

NSBluetoothPeripheralUsageDescription

蓝牙权限

NSCameraUsageDescription

使用相机权限

NSMicrophoneUsageDescription

使用麦克风权限

NSPhotoLibraryUsageDescription

使用相册权限

以上注意不能写错,而则为描述

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

你可能感兴趣的:(控制台输出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 exp)