Cordova 3.5 deviceready event not fired after 5 seconds

Rajesh picture Rajesh · Jul 8, 2014 · Viewed 7.6k times · Source

I recently upgraded my cordova app from cordova v2.9 to v3.5.0. After adding plugins from command-line, I imported my app to eclipse so that I can test on an android device. But, when I run the app, I see below logcat message:

07-08 11:24:03.359: I/Web Console(1500): deviceready has not fired after 5 seconds. at file:///android_asset/www/cordova/cordova.js:1154

07-08 11:24:03.359: D/CordovaLog(1500): file:///android_asset/www/cordova/cordova.js: Line 1147 : Channel not fired: onFileSystemPathsReady

07-08 11:24:03.359: I/Web Console(1500): Channel not fired: onFileSystemPathsReady at file:///android_asset/www/cordova/cordova.js:1147

According to Cordova Device ready doc, I had to bind deviceready inside document.ready(). It did not fire. Also tried binding it outside document.ready() according to some answers on SO. Still no luck. Can someone help me out???

Device ready event binding

function cordovaInit() {
    document.addEventListener('deviceready', initApp, false);
}

I call cordovaInit() from onload() of body element like below:

<body onload="cordovaInit()">

The deviceready issue is gone now, but I am getting a Nullpointer Exception as below:

07-08 18:58:40.750: W/System.err(6670): java.lang.NullPointerException
07-08 18:58:40.750: W/System.err(6670):     at org.apache.cordova.file.LocalFilesystem.filesystemPathForURL(LocalFilesystem.java:67)
07-08 18:58:40.750: W/System.err(6670):     at org.apache.cordova.file.LocalFilesystem.getFileForLocalURL(LocalFilesystem.java:189)
07-08 18:58:40.750: W/System.err(6670):     at org.apache.cordova.file.FileUtils.getFile(FileUtils.java:749)
07-08 18:58:40.760: W/System.err(6670):     at org.apache.cordova.file.FileUtils.access$5(FileUtils.java:742)
07-08 18:58:40.760: W/System.err(6670):     at org.apache.cordova.file.FileUtils$16.run(FileUtils.java:397)
07-08 18:58:40.760: W/System.err(6670):     at org.apache.cordova.file.FileUtils$23.run(FileUtils.java:525)
07-08 18:58:40.760: W/System.err(6670):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
07-08 18:58:40.760: W/System.err(6670):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
07-08 18:58:40.760: W/System.err(6670):     at java.lang.Thread.run(Thread.java:856)

Answer

Frix33 picture Frix33 · Sep 9, 2014

Same issue. Try to remove/update the File plugin, (org.apache.cordova.file) it's worked for me. OnFileSystemReady is an event of that plugin.