Plugins Not working :-( - Upgrade Cordova 5.1.1 from 4.3, Ionic CLI 1.3.15 to 1.6.1

Anyone have an issue with plugins not working when upgrading to Cordova 5? And anyone see a solution?

Been playing with this for a few hours and no dice. Added cordova-whitelist-plugin and enabled ALL requests in config.xml, and the meta tag in index.html.

Changed all plugins to reflect new NPM Id’s, also used ionic state reset to get a fresh start.

When starting the app, all the references to the plugins such as cordova.plugins.Keyboard, or window.navigator.splashscreen are null (plugins object is empty {})

I see all the correct src and www files copied over to the platforms so I am not sure what could possibly be wrong but I’m pulling my hair out ha!

Anyone with some insight on to what could be wrong please share!

Cordova CLI: 5.1.1
Gulp version:  CLI version 3.8.11
Gulp local:  (Still on Grunt for this project :-( )
Ionic Version: 1.0.1
Ionic CLI Version: 1.6.1
Ionic App Lib Version: 0.3.3
ios-deploy version: 1.4.0 
ios-sim version: 3.1.1 
OS: Mac OS X Mavericks
Node Version: v0.12.5

Been having the same issue. Don’t know the solution though. I having been trying to add a custom camera cordova plugin. Tried a couple out there but they don’t seem to work. Don’t know exactly whether it’s the plugins I’m using or just adding cordova plugins in general. I got the error cordova not defined but was running on a phone

@DaCardinal Not sure what was going on, or if I didn’t understand the CLI correctly, but using the CLI, my fetch.json and android.json files were all jacked up… not saying it was an issue with the CLI, could have been something I did backwards, but it didnt have all the plugins in there or dependent plugins.

I ended up removing all plugins/platforms and after changing the plugin ID’s in package.json, and manually added each plugin and double checked that it was added to the fetch.json correctly… Then I did a plaform add, and verified that the plugin was added to the android/ios.json correctly and verified they were copied over correctly. Then I adde crosswalk, ran and everything was back to normal.

Hope this helps.

A tip I would give you is if you experience plugin issues, you can delete a platform using the CLI ionic plugin remove com.etc.plugin and then run ionic state restore this will re-generate and ensure all of the plugins etc for your platforms.

1 Like