ios Xcode:缺少 NSCameraUsageDescription 的 Info.plist 键

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44690075/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 09:16:04  来源:igfitidea点击:

Xcode: Missing Info.plist key for NSCameraUsageDescription

iosxcodegpuimage

提问by Chris

After adding GPUImageto my Xcodeproject, my app is getting denied for Missing an Info.plistkey for NSCameraUsageDescription.

加入后,GPUImage我的Xcode项目,我的应用程序越来越否认失踪的一个Info.plist关键NSCameraUsageDescription

Missing Info.plistkey - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plistmust contain an NSCameraUsageDescriptionkey with a string value explaining to the user how the app uses this data.

缺少Info.plist密钥 - 此应用程序尝试在没有使用说明的情况下访问隐私敏感数据。应用程序Info.plist必须包含一个NSCameraUsageDescription带有字符串值的 键,向用户解释应用程序如何使用这些数据。

I have added the key and description to my plist in several different ways and over 10 builds have all gotten the same denial error.

我以几种不同的方式将密钥和描述添加到我的 plist 中,并且超过 10 个构建都遇到了相同的拒绝错误。

Here is my info.plistwith the Camera Usage key at the bottom.

这是info.plist底部的相机使用键。

Snap of my info.plist

我的 info.plist 快照

Any ideas on why I still get denied when I clearly have this defined in my plist?

当我在 plist 中明确定义了这一点时,为什么我仍然被拒绝?

回答by Nirmalsinh

You need to put a particular and proper descriptionto use Camera in your application. One my application is denied due to improper description. So try with a proper description, maybe it will help you.

您需要在应用程序中添加特定且正确的描述才能使用相机。一个我的申请因描述不当而被拒绝。因此,尝试使用适当的描述,也许它会对您有所帮助。

<key>Privacy - Camera Usage Description</key>
<string>APPNAME requires access to your phone's camera.</string>

回答by user10078

Ok it is an old one but i'd share my experience... nothing was working for me. What i add to to was :

好的,这是一个旧的,但我会分享我的经验......没有什么对我有用。我要补充的是:

  • using Xcode to edit the plist.info. NOTin an external editor !!!!

  • DO NOTedit the text CREATEa new key using the + sign.

  • it will ask you to replace the previous (unless the previous one has been entered wrong... my case i think)

  • 使用 Xcode 编辑 plist.info。不在外部编辑器中!!!!

  • 请勿使用 + 号编辑文本CREATEa new key。

  • 它会要求您替换前一个(除非前一个输入错误......我认为是我的情况)

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

回答by Bala

Try the both Camera and Library permission in Plist.

在 Plist 中尝试相机和库权限。

<key>NSCameraUsageDescription</key>
<string>Access camera</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Library</string>

回答by Amal T S

You should enter the purpose of using camera as the description. If it does not give the purpose app will get rejected.

您应该输入使用相机的目的作为描述。如果它没有给出目的应用程序将被拒绝。

you should add something like Appname requires to access camera for taking profile pictureor Appname requires to access camera for uploading product images

您应该添加类似 Appname 需要访问相机才能拍摄个人资料图片Appname 需要访问相机才能上传产品图片的内容

From the apple: Check thislink.

来自苹果:检查链接。

To protect user privacy, an iOS app linked on or after iOS 10.0, and that accesses the device's camera, must statically declare the intent to do so. Include the NSCameraUsageDescription key in your app's Info.plist file and provide a purpose string for this key. If your app attempts to access the device's camera without a corresponding purpose string, your app exits.

为了保护用户隐私,在 iOS 10.0 上或之后链接的 iOS 应用程序访问设备的相机,必须静态声明这样做的意图。在应用程序的 Info.plist 文件中包含 NSCameraUsageDescription 键,并为此键提供一个用途字符串。如果您的应用尝试在没有相应用途字符串的情况下访问设备的相机,您的应用将退出。

回答by DaniFoldi

I know this is an older post, but for me, it took an hour to discover that I was not editing the correct Info.plist file, but the one for UI Tests. Double-check which one you are editing, it can be the cause.

我知道这是一篇较旧的帖子,但对我来说,花了一个小时才发现我没有编辑正确的 Info.plist 文件,而是用于 UI 测试的文件。仔细检查您正在编辑哪一个,这可能是原因。

回答by Developer

GPUImage is for capturing image and video, i guess adding Microphone permission might solve the issue

GPUImage 用于捕获图像和视频,我想添加麦克风权限可能会解决问题

<key>NSCameraUsageDescription</key>
    <string>Need to access your camera to capture a picture and record a video.</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>Need to access your microphone to record a video.</string>

回答by JBurton

I got the same error as OP. I don't know why though because I wasn't using anything related to the camera in my app. So I included this as the description and worked.

我遇到了与 OP 相同的错误。我不知道为什么,因为我没有在我的应用程序中使用任何与相机相关的东西。所以我把它作为描述并工作。

"AppName does not use the camera to capture to take a profile picture or upload profile photos."

“AppName 不使用相机拍摄来拍摄个人资料照片或上传个人资料照片。”

回答by Lal Krishna

For app store submission, The Usage description should briefly explain why we really needs that feature.

对于应用商店提交,使用说明应该简要解释我们为什么真正需要该功能。

Description:

描述:

Camera Use

相机使用

is too short and doesn't explains why we actually need camera.

太短了,并没有解释为什么我们实际上需要相机。

It should be something like:

它应该是这样的:

App Needs to use camera to take Profile picture

应用程序需要使用相机拍摄个人资料图片

回答by Han-byul Yoo

If you write Privacy - Camera Usage Description,

如果你写隐私 - 相机使用说明,

change to NSCameraUsageDescription

更改为 NSCameraUsageDescription

回答by Anand Khanpara

try!

尝试!

<key>NSCameraUsageDescription</key>
<string>Need to access your camera to capture a photo add and update profile picture.</string>

<key>NSPhotoLibraryUsageDescription</key>
<string>Need to access your photo library to select a photo add and update profile picture</string>