iOS This app has crashed because it attempted to access privacy-sensitive data without a usage descripti

This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an(报错的权限KEY) NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.

控制台打印类似的报错信息都是因为权限问题,没有经过用户许可使用某些权限,如相机。。

解决方案

  1. 打开info.plist
    添加一个选项
    键 - NSPhotoLibraryUsageDescription
    值 String- 随意填写会显示在第一次调用次权限的alert view的子标题中。

  2. 打开info.plist source code
    添加一下键值对
    NSPhotoLibraryUsageDescription
    App 需要您的同意才能读取媒体资料库

你可能感兴趣的:(iOS This app has crashed because it attempted to access privacy-sensitive data without a usage descripti)