cordova windows error: “cordova/windows8/commandProxy” not found

自作多情 提交于 2019-12-01 18:16:04

问题


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


回答1:


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);


来源:https://stackoverflow.com/questions/30069134/cordova-windows-error-cordova-windows8-commandproxy-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!