Matching error with ChildBrowser and PhoneGap 1.5.0 (Cordoba)

When I try to call:

window.plugins.childBrowser.showWebPage

I get this error in the console window:

2012-03-13 16: 14: 58.036 CordovaHybridDemo [874: 707] ERROR: The plugin 'ChildBrowserCommand' was not found or is not a CDVPlugin. Check the plugin in the Cordova.plist file.

I added an entry to Cordova.plist with the ChildBrowserCommand key and the ChildBrowserCommand value. This worked in PhoneGap 1.4.1, but has it changed for Cordoba?

+8
javascript iphone cordova
source share
2 answers

Cordoba is changing its plugin architecture. Including keywords and class files.

Check the file ChildBrowserCommand.h

@interface ChildBrowserCommand : CDVPlugin <ChildBrowserDelegate> 

For this. If this is not CDVPlugin, you have not updated your plugin files successfully. An analogy can be applied to Android.

Also check out the updated js file for the plugin.

 var cordovaRef = window.PhoneGap || window.Cordova || window.cordova; // old to new fallbacks 

Here they make plugins suitable for the new cordova.

Refer to the Cordova plugin update guide https://github.com/phonegap/phonegap-plugins/blob/master/iOS/README.md

+1
source share

The answer is right here , in the picture , He does not mention it in the text, but this key / value pair should be nested under the plugins.

I struggled with this for a while before I noticed that I messed it up. I blame the Xcode user interface: if you press "+ on plugins" when it is closed, it just creates a sibling, not a child. Also my first mistake was to completely put this key pair in the wrong plist: P.

0
source share

All Articles