cordova-app-loader icon indicating copy to clipboard operation
cordova-app-loader copied to clipboard

Update doesn't work on Android (check and download is ok) [ionic]

Open przygrubyu5 opened this issue 8 years ago • 3 comments

Hi @markmarijnissen

  1. Android devices -HTC One X
  2. Chrome is working, but had error, I understand image

3.Android check and download ok, but not update

[ionic] code in loginController $scope.checkUpdate = function () { var fs = new CordovaPromiseFS({ persistent: typeof $window.cordova !== 'undefined', Promise: $q });

// Initialize a CordovaAppLoader
var loader = new CordovaAppLoader({
    fs: fs,
    serverRoot: $rootScope.baseSourceUrl + '/pcberpapp/www/',
    localRoot: 'app',
    cacheBuster: true, // make sure we're not downloading cached files.
    checkTimeout: 10000 // timeout for the "check" function - when you loose internet connection
});

loader.check().then(function (updateAvailable) {        
    if (updateAvailable)
    {              
        loader.download(onProgress)
        .then(
          function (manifest)
          {
              console.log(manifest);
              loader.update();
              $scope.doLogin();
          },
          function (failedDownloadUrlArray)
          {
              console.log(failedDownloadUrlArray);
          }
        )
    }else {
      $scope.doLogin();
    }
});

};

img_0761

img_0760

  1. login.html in manifest.json
  2. I change login.js and update manifest on serve

Please hele me!

przygrubyu5 avatar May 11 '16 04:05 przygrubyu5

Strange. I need console logs of the device to debug the error.

Connect your device in debugging mode, install a debug-version of the app, and then goto chrome://inspect to checkout your logs.

Or if you use an IDE for android apps, you could see logs there.

I would check:

  • After reload, is manifest.json updated? Particulary, is the Manifest.root configured?

markmarijnissen avatar May 12 '16 08:05 markmarijnissen

use ionic and google Chrome and Sublime, not use IDE.

przygrubyu5 avatar May 13 '16 10:05 przygrubyu5

image

image

przygrubyu5 avatar May 13 '16 11:05 przygrubyu5