Cordova plugins not working
Checklist: Is your plugin loaded?
- Does your
index.html
load thecordova.js
script? (i.e. if you havewww/index.html
then you can just referencecordova.js
. This file is not in thewww
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. aplugins
folder with scripts,cordova_plugins.js
should mention your plugin, a platform-specificcordova.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:
- The
file
,file-transfer
, andcamera
plugins are all dependent on thecompat
plugin; socompat
needs to be removed last. - The
file-transfer
plugin is dependent onfile
, sofile
needs to be removed first.