在CCA罚球&QUOT运行离子;不能读取属性未定义的&QUOT的“键盘”; @ app.js:14 [英] Running Ionic at cca throw "Cannot read property 'Keyboard' of undefined" @ app.js:14
问题描述
下面是我在Chrome应用移动做了设置离子:
The following is what I did to setup Ionic in Chrome App for Mobile:
- 创建一个Chrome应用移动项目 -
CCA创建项目名称
- 创建了一个项目离子
离子开始projectname_ionic
- 删除所有来自Chrome应用www文件夹中的文件,除了清单文件和background.js -
找到项目名称/ WWW / * - 不是-name'清单*'| grep的-vbackground.js| xargs的RM -rf
- 复制的离子项目www文件夹中的Chrome应用www文件夹内容 -
CP -r projectname_ionic / WWW / *项目名称/网络/
- 注释掉
< SCRIPT SRC =cordova.js>< / SCRIPT>
在项目名称/网络/ index.html的,因为CCA自动已注入它
- Created a Chrome App for Mobile project -
cca create projectname
- Created an Ionic project
ionic start projectname_ionic
- Deleted all of the files from the Chrome App www folder except the manifest files and background.js -
find projectname/www/* -not -name 'manifest*' | grep -v 'background.js' | xargs rm -rf
- Copied the content of the Ionic project www folder to the Chrome App www folder -
cp -r projectname_ionic/www/* projectname/www/
- Commented out
<script src="cordova.js"></script>
at projectname/www/index.html since cca automatically inject it already
当试图运行项目从我收到以下错误app.js行14日 -
When trying to run the project I get the following error from app.js line 14 -
遗漏的类型错误:无法读取的未定义的属性键盘
Uncaught TypeError: Cannot read property 'Keyboard' of undefined
当在Chrome的开发工具控制台(远程调试) window.cordova
我得到现有的对象类型,所以问题是,window.cordova.plugins是不确定的。
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应用程序本身并在移动加载,我可以切换标签,但在朋友标签,当我点击一个名字我看到它得到了点击,但没有发生的旁边。
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.
我也试过以下内容:
- projectname_ionic /插件有3个插件,该项目名称/插件,错过了,所以我说他们使用CCA插件添加到... PROJECTNAME /
- 运行
离子平台的android添加
在projectname_ionic /复制文件之前 - 试过几个老版本的离子(绝望,我知道:))
- 和其他一些尝试,我已经忘了...
- projectname_ionic/plugins had 3 plugins which projectname/plugins missed so I added them using cca plugin add ... to projectname/
- Run
ionic platform add android
at projectname_ionic/ before copying the files - Tried few older versions of Ionic (desperate I know :))
- And some other tries which I forgot already...
任何人有一个想法,我应该怎么办?
Anyone got an idea what should I do?
在此先感谢!
推荐答案
我开始移除插件目录(我有一个钩子被添加插件,附加平台的一部分)后,得到同样的错误。有3个插件,离子增加了一个新的项目。我没有键盘和控制台为那些我钩的一部分。
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 com.ionic.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.
另外,如果被删除node_modules,NPM安装将需要。
Also, if node_modules was removed, npm install
will be needed.
这篇关于在CCA罚球&QUOT运行离子;不能读取属性未定义的&QUOT的“键盘”; @ app.js:14的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!