PhoneGap 3 plugin: exec() call to unknown plugin "..."

Remy Sharp picture Remy Sharp · Jul 31, 2013 · Viewed 14.2k times · Source

I've been trying to upgrade a plugin to v3, and I've managed to get past the plugin loading issues, and I've managed to expose the plugin to the client environment (making changes to the way exec works, etc).

But when I watch the adb logcat with

adb logcat | grep -v nativeGetEnabledTags | grep -i web

I get this error:

D/PluginManager(11189): exec() call to unknown plugin: WebSocket

I can't work out what's gone wrong, and I'm not sure why the Android build can't see the plugin.

I've pushed ALL the code to a github repo, so if someone is able to replicate and help I'd be very welcome! I'm also trying to write up my experience of the conversion and logging the gotchas as I hit them (there's some in the readme, though it's incomplete):

Here's the repo: https://github.com/remy/phonegap_test

– Remy

Answer

Sandeep Kumar picture Sandeep Kumar · Sep 16, 2013

define your plugin in "res/xml/config.xml"

find these lines in the file

<feature name="App">
        <param name="android-package" value="org.apache.cordova.App" />
</feature>

and append these right after:

<feature name="MyPluginName">
        <param name="android-package" value="com.phonegap.plugins.plugin.class" />
</feature>

replace the dummy names (MyPluginName, plugins.plugin.class, etc) with the actual names. This works for me when I was getting this error:

exec() call to unknown plugin : MyPluginName