在Visual Studio中通过config.xml添加插件参数不起作用 [英] Adding plugin parameters through config.xml in Visual Studio doesn't work

查看:145
本文介绍了在Visual Studio中通过config.xml添加插件参数不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将VS2013 Update 4与Apache Cordova Tools CTP 3.1一起使用.我一直在努力安装两个插件,两个插件都在plugin.xml中使用<preference>标记.

I am using VS2013 Update 4 with Apache Cordova Tools CTP 3.1. I have been struggling with installing two plugins where both of them use the <preference> tag in their plugin.xml.

它与

It is basically the same as this but the suggestions in the answers don't seem to help at all. It also seems like the problem is not specific to the Facebook Connect plugin, hence this new question.

https://msdn.microsoft.com/en-us/library/dn757051.aspx#Configuring 显示通过config.xml支持向插件添加参数,但是到目前为止我还没有运气.

https://msdn.microsoft.com/en-us/library/dn757051.aspx#Configuring shows that adding parameters to plugins is supported through config.xml but I didn't have any luck with it so far.

<vs:plugin name="com.phonegap.plugins.facebookconnect" version="0.8.1">
    <param name="APP_ID" value="12345678" />
    <param name="APP_NAME" value="My Facebook App" />
</vs:plugin>

我得到:

TypeError:无法使用'in'运算符在未定义的位置搜索'APP_ID'

TypeError: Cannot use 'in' operator to search for 'APP_ID' in undefined

以下插件也是如此: https://github.com/EddyVerbruggen/Custom-URL-scheme

Same goes for the following plugin: https://github.com/EddyVerbruggen/Custom-URL-scheme

<vs:plugin name="nl.x-services.plugins.launchmyapp" version="3.2.2">
    <param name="URL_SCHEME" value="appname" />
</vs:plugin>

我在哪里:

TypeError:无法使用'in'运算符搜索未定义的URL_SCHEME'

TypeError: Cannot use 'in' operator to search for URL_SCHEME' in undefined

我已经为此苦苦挣扎了一段时间,但似乎没有解决的办法.有没有人看到过同样的问题,如果可以,找到了解决方案?

I have been struggling with this for a while now but there doesn't seem to be a solution. Has anyone seen the same problem and if so, found a solution?

推荐答案

不幸的是,由于Cordova问题,您可能会在Cordova<中遇到插件变量的问题. 5.0.0.如果在平台"之前安装插件",则会丢失插件变量信息,具体取决于您的工作流程.但是,它们确实在Cordova 5.0.0中起作用,您可以将它们与VS 2015 RC一起使用.要更新到5.0.0并使用插件变量,您将需要更新VS项目并使用命令行.

Unfortunately, due to a Cordova issue, you can run into problems with plugin variables in Cordova < 5.0.0. Plugin variable information is lost if you install the "plugin" be fore the "platform" which can happen depending on your workflow. They do, however, function in Cordova 5.0.0 which you can use with VS 2015 RC. To update to 5.0.0 and use plugin variables, you will need to update your VS project and use the command line.

  1. 通过配置设计器删除带有变量的插件.
  2. 通过配置设计器(平台> Cordova CLI)更新到Cordova 5.0.0
  3. 从命令行:
  1. Remove the plugins with the variables via the config designer.
  2. Update to Cordova 5.0.0 via the config designer (Platforms > Cordova CLI)
  3. From the command line:
  1. 转到您的项目目录.
  2. 键入以下内容,将插件名称替换为您要添加的插件:
  1. Go to your project directory.
  2. Type the following substituting the plugin name for the plugin you wish to add:
  1. npm install -g cordova
  2. cordova插件添加nl.x-services.plugins.launchmyapp --variable URL_SCHEME = myscheme

此问题正在积极处理中,因此将来应该会有所改善. 您还需要在使用时注意与5.0.0有关的其他已知问题.

This issue is actively being worked so things should improve in the future. You will also want to take note of the additional known issues pertaining to 5.0.0 when using it.

https://www.visualstudio.com/explore/cordova-known-问题-vs

您还需要注意在为iOS构建时为Cordova插件注册表为Facebook报告的错误.由于Windows上的NTFS文件系统,这也可能导致VS问题.这是解决此问题的可能方法: https://github.com/Chuxel/taco-tricks/tree/master/ios-plugin-symlink-fix

You will also want to note the bug reported for the Facebook for the Cordova plugin registry when building for iOS. This will also likely cause issues with VS due to the NTFS file-system on Windows. Here is a possible fix for this problem: https://github.com/Chuxel/taco-tricks/tree/master/ios-plugin-symlink-fix

这篇关于在Visual Studio中通过config.xml添加插件参数不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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