我使用PhoneGap 2.9.0和SenchaTouch来开发我的 Android应用程序(targetSdkVersion 16). 当我在Chrome中启动应用时,我得到了这样的日志: Falling back on PROMPT mode since _cordovaNative is missing. Expected for Androi
当我在Chrome中启动应用时,我得到了这样的日志:
Falling back on PROMPT mode since _cordovaNative is missing. Expected for Android 3.2 and lower only. cordova.js:912 deviceready has not fired after 5 seconds. cordova.js:6725 Channel not fired: onCordovaConnectionReady cordova.js:6718 Channel not fired: onCordovaInfoReady cordova.js:6718
当我在三星平板电脑(Android 4.1.2)中测试它时,第一行消失了,但是3个事件总是不会被触发.
然而,似乎SenchaTouch工作得相当好:视图显示和交互工作正如我所料.
这是index.html的head部分:
<head> <meta charset="UTF-8"> <title>title</title> <!-- The line below must be kept intact for Sencha Command to build your application --> <script id="microloader" type="text/javascript" src="touch/microloader/development.js"></script> <style type="text/css"> some css here </style> <script type="text/javascript" charset="utf-8" src="pg/cordova.js"></script> <script type="text/javascript" charset="utf-8" src="pg/barcodescanner.js"></script> </head>
我使用了一些phonegap API,如Camera和File.由于PhoneGap从未收到deviceready事件,因此API不可用,因此navigator.camera未定义.
我做了一个拥抱研究,但我测试的所有都没有解决问题.欢迎任何建议
提前致谢
简单地评论它们直到我在我的代码中引用它们给了我一个立即“Phonegap准备就绪”.
谢谢你:http://community.phonegap.com/nitobi/topics/deviceready_has_not_fired_after_5_seconds