Cordova File plugin never becomes ready in Android

前端 未结 3 1822
花落未央
花落未央 2021-01-06 01:05

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

相关标签:
3条回答
  • 2021-01-06 01:18

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

    cordova plugin add org.apache.cordova.file@1.1.0
    

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

    0 讨论(0)
  • 2021-01-06 01:21
    You need to include cordova plugin before closing of body tag , so that cordova gets loaded properly before body loading completes.
    
    
    <!doctype html>
    <html>
        <head>
        </head>
        <body>
    
            <script src='cordova.js' type='text/javascript'></script>
            <script src='index.js' type='text/javascript'></script>
        </body>
    </html>
    
    0 讨论(0)
  • 2021-01-06 01:36

    I ran into the same issue.

    What worked for me was using a different version of the File plugin found here: https://github.com/onflapp/cordova-plugin-file

    Related topic: Android - Cordova 3.5.0 deviceready not firing after installing media plugin

    0 讨论(0)
提交回复
热议问题