如何解决“Missing Info.plist键… NSPhotoLibraryUsageDescription”

我使用应用程序加载程序完全上传我的.ipa文件,但是我没有findbuild立在Itunes Connect上的内容,我也收到了苹果支持的这个消息:“我们已经发现一个或多个与你最近交付的”更新HF“有关的问题。您的交付,必须更正以下问题:缺lessInfo.plist键 – 此应用程序尝试访问隐私敏感的数据,没有使用说明。应用程序的Info.plist必须包含一个string值的NSPhotoLibraryUsageDescription键,向用户解释应用程序使用这些数据。“

我将下面的代码添加到config.xml文件,但我仍然有同样的错误:

在这里输入图像说明 您可以在plist中添加下面的行。

 <key>NSCameraUsageDescription</key> <string>$(PRODUCT_NAME) uses photos</string> <key>NSPhotoLibraryUsageDescription</key> <string>$(PRODUCT_NAME) uses photos</string> 

编辑:所有的核心插件已经更新,不再使用variables。 要设置使用说明,您必须在config.xml使用edit-config标签,如下所示:

 <edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge"> <string>need camera access to take pictures</string> </edit-config> 

请参阅iOS怪癖部分

老解答:先用cordova plugin rm cordova-plugin-camera删除cordova-plugin-camera cordova plugin rm cordova-plugin-camera

然后再次安装它:

 cordova plugin add cordova-plugin-camera --variable PHOTOLIBRARY_USAGE_DESCRIPTION="your usage message" 

我正在使用VS TACO,这是我最终如何解决这个问题。 编辑\ plugins \ fetch.json文件,使“cordova-plugin-camera”添加“variables”部分:

 "cordova-plugin-camera": { "source": { "type": "registry", "id": "cordova-plugin-camera@~2.4.1" }, "is_top_level": true, "variables": { "CAMERA_USAGE_DESCRIPTION": "your description text here", "PHOTOLIBRARY_USAGE_DESCRIPTION": "your description text here" } }