Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 416
Remy Sharp Avatar asked Jul 31 '13 15:07

Remy Sharp


3 Answers

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

like image 121
Sandeep Kumar Avatar answered Nov 15 '22 18:11

Sandeep Kumar


I am all of a sudden getting the same issue with my phone gap build (2.6). Same exact code worked prior so it must be a build issue.

Did you tried to open your apk and see if config.xml is included (there is where plugins are defined).

like image 25
nurieta Avatar answered Nov 15 '22 19:11

nurieta


On Android Studio 1.0.1 (running on Mac OS 10.9.5) + Cordova 4.2.0, I fixed a similar problem ("exec() call to unknown plugin") as follow:

it happened that the content of the tag:

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

Under YourCordovaProjectName/config.xml was not duplicated under YourCordovaProjectName/platforms/android/res/xml/config.xml

I had to alter the file config.xml under YourCordovaProjectName/platforms/android/res/xml/ and to add the tag:

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

Then it worked.

I will also add that I've experienced the same problem with IOS, I had to enter manually:

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

In the file config.xml under the folder YourCordovaProjectName/platforms/ios/YourCordovaProjectName

Hopefully that will be fixed in the future and the content of YourCordovaProjectName/config.xml will correctly be reflected in the config.xml files that are under each specific platforms (it used to worked correctly for Android few months ago).

like image 26
nyluje Avatar answered Nov 15 '22 19:11

nyluje