Shehbaz Khan
Shehbaz Khan

Reputation: 1990

The app's Info.plist must contain an NSContactsUsageDescription key

I am getting a crash below:

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.

But I have already added the 'Privacy - Contacts Usage Description' key

enter image description here

Upvotes: 9

Views: 14274

Answers (5)

boxed
boxed

Reputation: 4417

I had this problem. There was no Info.plist in a new project and adding it didn't do anything.

Solution:

  • Click project
  • Select Info tab
  • HERE you can add stuff!

Upvotes: 1

islam XDeveloper
islam XDeveloper

Reputation: 500

Go To info.plist And

Privacy - Contacts Usage Description

Value : Allow Contact Access For Details

enter image description here

Upvotes: 1

Naqeeb
Naqeeb

Reputation: 1421

if you are using App test and and App UItest then there would be multple plist files in your project just make it sure you are adding discription in right if plist

enter image description here

Upvotes: 0

Jere Käpyaho
Jere Käpyaho

Reputation: 1315

Could be that you have accidentally added the key to your UITests target. I've done that a few times with the location privacy keys.

By the way, your contacts usage description "Allow contact access" probably would not pass Apple's review, because it does not state why you want to use them.

Upvotes: 2

eugene
eugene

Reputation: 116

Please check your .plist as a source code and see if your key doesn't contain space at the end like:

<key>NSContactsUsageDescription </key>

Upvotes: 8

Related Questions