【问题标题】:iOS - App crashed because it attempted to access privacy - sensitive data without a usage descriptioniOS - 应用程序崩溃,因为它试图访问没有使用说明的隐私敏感数据
【发布时间】:2017-01-30 20:38:00
【问题描述】:

我收到以下错误:

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

你知道如何解决这个问题吗?

【问题讨论】:

标签: ios


【解决方案1】:

这些是在您的项目的plist 中设置的。您可以通过导航到目标信息检查器并展开“自定义 iOS 目标属性”部分来添加/删除这些。例如,我的一个项目中的一个条目是:

Privacy - Camera Usage Description
Allows user to capture a photo or video to upload to their family circle

你可以在这里看到它的样子:

【讨论】:

    【解决方案2】:

    您需要转到您的 Info.plist,添加一个新行并将 NSPhotoLibraryUsageDescription 粘贴到键列中。然后在值列中描述为什么需要访问用户的照片库。如果您打算使用设备的摄像头,请对 NSCameraUsageDescription 重复相同的步骤。

    【讨论】:

      猜你喜欢
      • 2017-05-13
      • 2017-02-11
      • 1970-01-01
      • 1970-01-01
      • 2018-04-18
      • 1970-01-01
      • 2018-01-23
      • 2017-01-15
      相关资源
      最近更新 更多