Error::Plugin not allowed in config.xml - Cordova/Phonegap

我怕爱的太早我们不能终老 提交于 2019-12-13 21:13:39

问题


I am trying to create my first plugin in wp8, but I am getting this error

Plugin not allowed in config.xml.

What am I doing wrong?

In config.xml

  <feature name="Echo">
        <param name="wp-package" value="com.example.echo.plugins.Echo"/>
  </feature> 

In echo.js

window.echo = function (str, callback) {
    cordova.exec(callback, function (err) {
        callback('Nothing to echo.');
    }, "com.example.echo.plugins.Echo", "echo", [str]);
};

In echo.cs

using WPCordovaClassLib.Cordova;
using WPCordovaClassLib.Cordova.Commands;
using WPCordovaClassLib.Cordova.JSON;

namespace com.example.echo.plugins
{
    class Echo : BaseCommand
    {
        public void echo(string options)
        {
...


回答1:


In echo.js

only Class Name has to be called and not the full package. As below:

window.echo = function (str, callback) {
    cordova.exec(callback, function (err) {
        callback('Nothing to echo.');
    }, "Echo", "echo", [str]);
};


来源:https://stackoverflow.com/questions/26912467/errorplugin-not-allowed-in-config-xml-cordova-phonegap

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