Running Ionic at cca throw “Cannot read property 'Keyboard' of undefined” @ app.js:14

狂风中的少年 提交于 2019-12-01 17:25:23
Irena Shai

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.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!