cordova窗口错误:“cordova / windows8 / commandProxy”未找到 [英] cordova windows error: "cordova/windows8/commandProxy" not found

查看:176
本文介绍了cordova窗口错误:“cordova / windows8 / commandProxy”未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了一个基于Cordova的Windows应用程序。一旦我添加任何插件,应用程序开始崩溃与 cordova / windows8 / commandProxy未找到



Cordova版本:4.3.0

解决方案

看起来 cordova / windows8 / commandProxy 在Cordova 4.3.0中已弃用。

  require( cordova / windows8 / commandProxy)

  require(cordova / exec / proxy)

它似乎工作。



例如,我改变了PushPluginProxy.js中的行号18从

  require(cordova / windows8 / commandProxy)。add(PushPlugin,module.exports); 

  require(cordova / exec / proxy)。add(PushPlugin,module.exports); 

字符串中的名称因插件而异。



或者,您可以修补插件,如此拉取请求从AppVersion插件即:



更改

  require(cordova / windows8 / commandProxy)。add(AppVersion,AppVersionProxy); 

  cordova.commandProxy.add(AppVersion,AppVersionProxy); 


I have built a Cordova-based Windows application. As soon as I add any plugin, the app starts crashing with the exception cordova/windows8/commandProxy not found.

Cordova version: 4.3.0

解决方案

It seems that cordova/windows8/commandProxy is deprecated in Cordova 4.3.0.

I have replaced this statement in plugin file

require("cordova/windows8/commandProxy")

to

require("cordova/exec/proxy")

and it seems to work.

For example I changed line number 18 in PushPluginProxy.js from

require("cordova/windows8/commandProxy").add("PushPlugin", module.exports);

to

require("cordova/exec/proxy").add("PushPlugin", module.exports); 

The name in the string varies depending on the plugin.

Alternatively, you can patch the plugin like in this pull request from the AppVersion plugin i.e.:

Change

require("cordova/windows8/commandProxy").add("AppVersion", AppVersionProxy);

to

cordova.commandProxy.add("AppVersion", AppVersionProxy);

这篇关于cordova窗口错误:“cordova / windows8 / commandProxy”未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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