Cordova plugins not working

Checklist: Is your plugin loaded?

  • Does your index.html load the cordova.js script? (i.e. if you have www/index.html then you can just reference cordova.js. This file is not in the www directory, but automatically generated by Cordova and inserted in your app)
  • Is the plugin javascript loaded? Use Chrome or Safari to remote debug your android/iOS app.
  • cordova plugin ls: Is your plugin listed?
  • plugins/android.json: Is your plugin listed?
  • Does platforms/android/assets/www have all files? (i.e. a plugins folder with scripts, cordova_plugins.js should mention your plugin, a platform-specific cordova.js)

Can you listen to the deviceready event to check if Cordova initializes at all? (If all scripts are in place)


If your plugins don't work you can also try these steps:

cordova plugin list;
cordova plugin remove my-cordova-plugin --save;
cordova plugin add my-cordova-plugin --nosave;

Also be aware of the following plugin dependencies:

  1. The file, file-transfer, and camera plugins are all dependent on the compat plugin; so compat needs to be removed last.
  2. The file-transfer plugin is dependent on file, so file needs to be removed first.