The following is what I did to setup Ionic in Chrome App for Mobile:
cca create projectname
ionic start projectname_ionic
find projectname/www/* -not -name 'manifest*' | grep -v 'background.js' | xargs rm -rf
cp -r projectname_ionic/www/* projectname/www/
<script src="cordova.js"></script>
at projectname/www/index.html since cca automatically inject it alreadyWhen trying to run the project I get the following error from app.js line 14 -
Uncaught TypeError: Cannot read property 'Keyboard' of undefined
When typing at the console of Chrome dev tools (remote debugging) window.cordova
I do get an existing object, so the problem is that window.cordova.plugins is undefined.
btw the app itself does load up at the mobile and I can switch tabs, but at the Friends tab when I click on a name I do see that it got clicked but nothing happen beside that.
I also tried the following:
ionic platform add android
at projectname_ionic/ before copying the filesAnyone got an idea what should I do?
Thanks in advance!
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With