问题描述
我已经建立了一个基于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);
字符串中的名称因插件而异。
或者,您可以修补插件,如即:
更改
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”未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!