【发布时间】:2013-12-02 05:37:18
【问题描述】:
我正在尝试使用 phonegap 3.1 构建一个 Hellow World 电话间隙应用程序。
我执行以下操作来生成我的应用程序
- phonegap create WinREOCRM --id "com.winreocrm" --name "WinREOCRM"
- phonegap 本地构建 android
- phonegap 本地运行 android
然后我转到我的 chrome open assets/www 文件夹,我可以看到正在加载,最后是设备就绪屏幕。然后我添加了一些插件网络插件,相机插件,文件上传插件。然后我再次使用我的 chrome 浏览器访问了 assets/www 文件夹。它只显示设备正在连接屏幕,从不显示设备连接屏幕。我在控制台中收到了这些消息
device ready has not fired after 5 seconds phonegap.js:1095
Channel not fired: onCordovaConnectionReady
这是我在 index.js 中的设备就绪功能
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
// deviceready Event Handler
//
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicity call 'app.receivedEvent(...);'
onDeviceReady: function() {
app.receivedEvent('deviceready');
},
我尝试了很多次,我不知道如何解决这个问题。我认为添加插件时会出现问题。请帮助我找到解决方案。非常感谢您的帮助。在此先感谢
【问题讨论】:
-
我也有这个问题。你找到解决方案了吗?
-
我只有在浏览器中运行时遇到这个问题,在设备中它正在工作。要在浏览器中运行它,我刚刚在 assets/www/cordova_plugin.js 文件中注释了“plugins/org.apache.cordova.network-information/www/network.js”文件。我不知道它是否适用于您的情况
-
这是一个已知问题,截至撰写本文时,尚未修复,请参阅此处提交的错误 [issues.apache.org/jira/browse/CB-5075]
标签: javascript android cordova sencha-touch