Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - App crashed because it attempted to access privacy - sensitive data without a usage description

Tags:

ios

I get the following error:

[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.

Do you know how to fix that?

like image 313
hulapalu Avatar asked Jan 30 '17 20:01

hulapalu


2 Answers

These are set in the plist for your project. You can add/remove these by navigating to your target info inspector and expanding the "Custom iOS Target Properties" section. For example, one of the entries here in a project of mine is:

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

You can see how this looks here:

example of project inspector

like image 71
Michael Fourre Avatar answered Oct 20 '22 01:10

Michael Fourre


You need to go to your Info.plist, add a new row and paste NSPhotoLibraryUsageDescription into the key column. Then in the value column give a description as to why you need to access the user's photo library. Repeat the same step with NSCameraUsageDescription if you intend to use the device's camera.

like image 40
Pierce Avatar answered Oct 20 '22 01:10

Pierce