PhoneGap缺少plist.key [英] PhoneGap missing plist.key

查看:139
本文介绍了PhoneGap缺少plist.key的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试加载上传我的iTunes应用程序安装程序到iTunes时我解除了这个错误:

When I try and load upload my iTunes app installer to iTunes I relieve this error:


缺少Info.plist键 - 此应用程序试图在没有使用说明的情况下访问隐私敏感的
数据。该应用程序的Info.plist必须包含一个
NSPhotoLibraryUsageDescription键,其字符串值向用户解释该应用程序使用此数据的

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

缺少信息.plist key - 此应用程序尝试访问隐私敏感的
数据而不使用用法说明。应用程序的Info.plist必须包含
NSCameraUsageDescription键,其中包含一个字符串值,向
用户解释应用程序如何使用此数据。

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

我可以在下面的配置文件中添加什么来使其工作:

What can I add to my config file below to let this work:

<preference name="permissions" value="none" />
    <preference name="orientation" value="default" />
    <preference name="target-device" value="universal" />
    <preference name="fullscreen" value="false" />
    <preference name="webviewbounce" value="false" />
    <preference name="disallowOverscroll" value="true" />
    <preference name="prerendered-icon" value="true" />
    <preference name="stay-in-webview" value="false" />
    <preference name="ios-statusbarstyle" value="black-opaque" />
    <preference name="detect-data-types" value="true" />
    <preference name="exit-on-suspend" value="false" />
    <preference name="show-splash-screen-spinner" value="true" />
    <preference name="auto-hide-splash-screen" value="true" />
    <preference name="disable-cursor" value="false" />
    <preference name="android-minSdkVersion" value="10" />
    <preference name="android-targetSdkVersion" value="19" />
    <preference name="android-installLocation" value="auto" />
    <gap:plugin name="org.apache.cordova.battery-status" source="npm" />
    <gap:plugin name="org.apache.cordova.camera" source="npm"/>    
    <gap:plugin name="org.apache.cordova.media-capture" source="npm"/>
    <gap:plugin name="org.apache.cordova.console" source="npm" />
    <gap:plugin name="org.apache.cordova.contacts" source="npm"/>

    <gap:plugin name="org.apache.cordova.device-motion" source="npm"/>
    <gap:plugin name="org.apache.cordova.device-orientation" source="npm"/>
    <gap:plugin name="org.apache.cordova.dialogs" source="npm"/>
    <gap:plugin name="org.apache.cordova.file" source="npm"/>
    <gap:plugin name="org.apache.cordova.file-transfer" source="npm"/>

    <gap:plugin name="org.apache.cordova.inappbrowser" source="npm"/>
    <gap:plugin name="org.apache.cordova.media" source="npm"/>
    <gap:plugin name="org.apache.cordova.network-information" source="npm"/>
    <gap:plugin name="org.apache.cordova.splashscreen" source="npm"/>
    <gap:plugin name="org.apache.cordova.vibration" source="npm"/>
    <icon src="icon.png" />

    <gap:splash src="splash.png" gap:platform="android" gap:qualifier="port-ldpi" />
    <gap:splash src="splash.png" gap:platform="android" gap:qualifier="port-mdpi" />
    <gap:splash src="splash.png" gap:platform="android" gap:qualifier="port-hdpi" />
    <gap:splash src="splash.png" gap:platform="android" gap:qualifier="port-xhdpi" />
    <gap:splash src="splash.png" gap:platform="blackberry" />
    <gap:splash src="splash.png" gap:platform="ios" width="320" height="480" />
    <gap:splash src="splash.png" gap:platform="ios" width="640" height="960" />
    <gap:splash src="splash.png" gap:platform="ios" width="640" height="1136" />
    <gap:splash src="splash.png" gap:platform="ios" width="768" height="1024" />
    <gap:splash src="splash.png" gap:platform="ios" width="1024" height="768" />
    <gap:splash src="splash.png" gap:platform="winphone" />
    <access origin="*" />

    <gap:plugin name=" phonegap-plugin-barcodescanner" source="npm" />
    <gap:plugin name="uk.co.workingedge.phonegap.plugin.launchnavigator" source="npm" />
    <gap:plugin name="cordova-plugin-directions" source="npm" />


    <!-- iPhone / iPod Touch  - lower 4s -->
    <icon src="icon-57.png" gap:platform="ios" width="57" height="57" />
    <icon src="icon.png" gap:platform="ios" width="114" height="114" />
    <icon src="icon-72.png" gap:platform="ios" width="72" height="72" />
    <icon src="152.png" gap:platform="ios" width="152" height="152" />
    <icon src="icon-120.png" gap:platform="ios" width="120" height="120" />
    <icon src="76.png" gap:platform="ios" width="76" height="76" />
    <icon src="icon-40.png" gap:platform="ios" width="40" height="40" />

    <!-- iPhone / iPod Touch - 5-5s -->
    <icon src="icon.png" gap:platform="ios" width="60" height="60" />
    <icon src="icon.png" gap:platform="ios" width="120" height="120" />
    <!-- iPhone6-6+ -->
    <icon src="icon.png" gap:platform="ios" width="180" height="180" />

    <!-- Settings Icon -->
    <icon src="icon-29.png" gap:platform="ios" width="29" height="29" />
    <icon src="icon.png" gap:platform="ios" width="58" height="58" />

    <!-- Spotlight Icon -->
    <icon src="icon.png" gap:platform="ios" width="40" height="40" />
    <icon src="icon.png" gap:platform="ios" width="80" height="80" />

    <plugin name="cordova-plugin-whitelist" version="1" source="npm"/>

    <gap:plugin name="cordova-plugin-geolocation" source="npm"/>

    <feature name="http://api.phonegap.com/1.0/battery" />
    <feature name="http://api.phonegap.com/1.0/camera" />
    <feature name="http://api.phonegap.com/1.0/network" />
    <feature name="http://api.phonegap.com/1.0/notification" />

    <gap:plugin name="cordova-plugin-x-socialsharing" source="npm" />


推荐答案

另一个编辑:
大多数插件删除了用法描述的变量,所以现在设置它们的方法是在config.xml中使用 edit-config 标签。

<edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="overwrite">
    <string>We are using the Camera for something...</string>
</edit-config>

但并非所有插件都已更新,所以最好先阅读插件的README.md。在核心插件上,它位于一个名为iOS Quirks的部分。

But not all plugins have been updated yet, so better read the plugin's README.md before. On the core plugins it's in a section called iOS Quirks.

它还需要cli 7.0.1或更新版本,在config.xml中设置如下:

It also needs the cli 7.0.1 or newer, set it in the config.xml like this:

<preference name="phonegap-version" value="cli-8.0.0" />

编辑:

我的旧回答否如果您有< preference name ='phonegap-version'value ='cli-7.0.1'/> (或者如果您没有 phonegap-version 因为它将默认使用它)

My old answer no longer works if you have <preference name='phonegap-version' value='cli-7.0.1' /> (or if you don't have any phonegap-version as it will use it as default)

要设置使用说明,请使用插件上的参数

To set the usage descriptions use the params on the plugin

<plugin name="cordova-plugin-camera">
   <param name="CAMERA_USAGE_DESCRIPTION" value="We are using the Camera for something..." />
   <param name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="We are using the Photo Library for something..." />
</plugin>

请注意,如果您的某些插件具有相同的使用说明,并且您没有使用参数填充它们标签可能会被默认的空字符串替换

Beware that if you have some plugins with the same usage descriptions and you don't fill them with param tags they might be replaced with the default empty string

您可以强制使用带有此标记的旧构建器,但不推荐使用,新构建器更好
<偏好名称='pgb-builder-version'值='1'/>

You can force to use the old builder with this tag, but it's not recommended, the new builder is better <preference name='pgb-builder-version' value='1' />

OLD答案:

您可以像这样在info.plist中写一下:

You can write in the info.plist like this:

<gap:config-file platform="ios" parent="NSCameraUsageDescription" overwrite="true">
   <string>We are using the Camera for something...</string>
</gap:config-file>

overwrite =true 非常重要,因为相机插件的最新版本已经写入空值。

The overwrite="true" is important because latest version of the camera plugin is already writing empty values.

我在一个示例应用程序上测试了它并且它正在工作
https://github.com/ jcesarmobile / phonegap-template-hello-world / blob / 454e852955e66470890cba636450abd422f50598 / config.xml#L153-L155

I have tested it on a sample app and it's working https://github.com/jcesarmobile/phonegap-template-hello-world/blob/454e852955e66470890cba636450abd422f50598/config.xml#L153-L155

这篇关于PhoneGap缺少plist.key的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆