电话间隙设备准备就绪,5秒钟后未启动

Phone gap device ready not fired after 5 seconds

本文关键字:5秒 启动 准备就绪 电话间 间隙 电话      更新时间:2024-01-07

我正试图使用phonegap 3.1构建一个Hello World电话间隙应用程序。

我做了以下操作来生成我的应用

  1. phonegap创建WinREOCRM--id"com.WinREOCRM"--name"WinREOCRM"
  2. phonegap本地构建android
  3. phonegap本地运行的android

然后我转到我的chrome-openassets/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');
},

我试了很多次,我不知道如何解决这个问题。我认为问题出现在我添加插件的时候。请帮我找到解决方案。非常感谢你的帮助。提前感谢

你可以试着打开你的cordova.js/phonegap.js,也许你只是使用像我这样的其他平台我在安卓项目上错误地使用了ios平台。

// Platform: ios
// 2.9.1
/*