iOS 10 App has crashed because it attempted to access privacy-sensitive data

Irfan picture Irfan · Oct 3, 2016 · Viewed 22.6k times · Source

I'm running my project which was working fine previously but after updating my xcode my app crashes and giving this error:

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

Answer

Anbu.Karthik picture Anbu.Karthik · Oct 3, 2016

Privacy Settings in iOS 10

A significant change in iOS 10 is that you must declare ahead of time any access to private data or your App will crash.

Once you link with iOS 10 you must declare access to any user private data types. You do this by adding a usage key to your app’s Info.plist together with a purpose string. The list of frameworks that count as private data is a long one

Contacts, Calendar, Reminders, Photos, Bluetooth Sharing, Microphone, Camera, Location, Health, HomeKit, Media Library, Motion, CallKit, Speech Recognition, SiriKit, TV Provider.

You need to put the NSCameraUsageDescription in your plist.

Like

<key> NSCameraUsageDescription </key>
<string>$(PRODUCT_NAME) uses Cameras</string>

for e.g

enter image description here

Check all the usage descriptions here.