1

My app was working smoothly in iOS 10 but not as i updated the application to iOS 11, application started to crash. And I am getting following 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 NSContactsUsageDescription key with a string value explaining to the user how the app uses this data.
xeb
  • 191
  • 1
  • 4
  • 12

4 Answers4

2

As your error is suggesting just add

"Privacy - Contacts Usage Description" 

into your info.plist. It will be of String type so add whatever popup message you want to show to the user asking for accessing his/her contact list. Eg. you may write "Application wants to access your contacts list."

Key will be "Privacy - Contacts Usage Description"
and 
Value will be "Application wants to access your contacts list."
Kadian
  • 644
  • 4
  • 6
1

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.

<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) photo use</string>

<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) camera use</string>

<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) microphone use</string>

<key>NSLocationUsageDescription</key>
<string>$(PRODUCT_NAME) location use</string>

<key>NSLocationWhenInUseUsageDescription</key>
<string>$(PRODUCT_NAME) location use</string>

<key>NSLocationAlwaysUsageDescription</key>
<string>$(PRODUCT_NAME) always uses location </string>

<key>NSCalendarsUsageDescription</key>
<string>$(PRODUCT_NAME) calendar events</string>

<key>NSRemindersUsageDescription</key>
<string>$(PRODUCT_NAME) reminder use</string>

<key>NSContactsUsageDescription</key>
<string>$(PRODUCT_NAME) contact use</string>

<key>NSMotionUsageDescription</key>
<string>$(PRODUCT_NAME) motion use</string>

<key>NSHealthUpdateUsageDescription</key>
<string>$(PRODUCT_NAME) heath update use</string>

<key>NSHealthShareUsageDescription</key>
<string>$(PRODUCT_NAME) heath share use</string>

<key>NSBluetoothPeripheralUsageDescription</key>
<string>$(PRODUCT_NAME) Bluetooth Peripheral use</string>

<key>NSAppleMusicUsageDescription</key>
<string>$(PRODUCT_NAME) media library use</string>

<key>NSSiriUsageDescription</key>
<string>$(PRODUCT_NAME) siri use</string>

<key>NSHomeKitUsageDescription</key>
<string>$(PRODUCT_NAME) home kit use</string>

<key>NSSpeechRecognitionUsageDescription</key>
<string>$(PRODUCT_NAME) speech use</string>

<key>NSVideoSubscriberAccountUsageDescription</key>
<string>$(PRODUCT_NAME) tvProvider use</string>

You can read all the Privacy descriptions here.

Kunal Gupta
  • 2,984
  • 31
  • 34
0

It is due to because you are trying to access sensitive data without seeking permission. To avoid this, you need to add a entry in your info.plist file in your all targets. And specify the valid reason to access sensitive data.

Thanks

0
<key>NSContactsUsageDescription</key>
<string>Required to show list of contacts</string>

just write this into your info.plist file.

Vipul Kumar
  • 893
  • 9
  • 19