简体   繁体   中英

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

在此处输入图像描述

请检查您的.plist作为源代码,看看您的密钥结尾是否不包含空格,例如:

<key>NSContactsUsageDescription </key>

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.

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

在此处输入图片说明

Go To info.plist And

Privacy - Contacts Usage Description

Value : Allow Contact Access For Details

enter image description here

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM