The following is what I did to setup Ionic in Chrome App for Mobile:
cca create projectname
When I tried to add the plugin on Mac OSX the plugin had a different name. You have to run this command in the project directory.
cordova plugin add ionic-plugin-keyboard
You can see the lib here: keyboard plugin
It sounds like you're not running this as an actual build -- are you using CADT? Even if you're testing with CADT on a device you will still NOT get window.cordova.plugins
. Once you build the project with cca build
and then install the apk on a device then the window.cordova.plugins
will be defined.
Hatzlacha
I started getting the same error after removing plugins directory (I had a hook that was adding the plugins as part of the add platform). There are 3 plugins that ionic adds for a new project. I did not have keyboard and console ones as part of my hook.
Check that you have following cordova plugins:
cordova plugin add ionic-plugin-keyboard
cordova plugin add org.apache.cordova.console
cordova plugin add org.apache.cordova.device
Once I added missing plugins to the ones added by hook the error was gone.
Also, if node_modules was removed, npm install
will be needed.