Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova File plugin never becomes ready in Android

I have a dead simple Cordova app with a single plugin: org.apache.cordova.file.

When I emulate the app in an android emulator, the deviceready event is never fired, and I get this as an output:

D/CordovaLog( 1841): file:///android_asset/www/cordova.js: Line 1154 : deviceready has not fired after 5 seconds.
D/CordovaLog( 1841): file:///android_asset/www/cordova.js: Line 1147 : Channel not fired: onFileSystemPathsReady

Some additional information:

cordova --version
3.5.0-0.2.4

javac -version
javac 1.7.0_55

java -version
java version "1.7.0_55"
OpenJDK Runtime Environment (IcedTea 2.4.7) (7u55-2.4.7-1~deb7u1)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)

index.html:

<!doctype html>
<html>
    <head>
    </head>
    <body>

        <script src='cordova.js' type='text/javascript'></script>
        <script src='index.js' type='text/javascript'></script>
    </body>
</html>

index.js:

(function() {

    "use strict";

    document.addEventListener("deviceready", function() {
        console.log("Ready");
    }, false);

}());

Is the Cordova File plugin broken? Am I doing something wrong? Has anyone else come across this issue and found a solution?

like image 882
SimpleJ Avatar asked Jun 26 '14 18:06

SimpleJ


1 Answers

Try installing the 1.1.0 version of the file plugin. Updating to 1.2.0 was a bad idea.

cordova plugin add [email protected]

This made the job for me on Android (and on iOS I stopped having other exotic problems).

like image 132
brickpop Avatar answered Nov 01 '22 01:11

brickpop