I'm trying out Ionic deploy. And it seems everything works fine up to the point of loading the app again after getting the update. I've provided screenshots. Let me know if there is anything else i can provide. Thank you.
Console error once the app is finished downloading and extracted, and then it tries to load it again.
Error on my webview
ionic source code for load method in deploy scripts
My javascript implementation:
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
screen.lockOrientation('portrait');
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
// Check for updates
$ionicDeploy.check().then(function(response) {
hide();
console.log(response);
// response will be true/false
if (response) {
show('Downloading update...');
// Download the updates
$ionicDeploy.download().then(function() {
hide();
show('Extracting update...');
// Extract the updates
$ionicDeploy.extract().then(function() {
hide();
// Load the updated version
$ionicDeploy.load();
}, function(error) {
show('Error extracting new update...');
setTimeout(function(){
hide();
}, 1500);
// Error extracting
}, function(progress) {
show('Extract progress...' + progress);
// setTimeout(function(){
// hide();
// }, 5000);
// Do something with the zip extraction progress
// $scope.extraction_progress = progress;
});
}, function(error) {
show('Error downloading...');
setTimeout(function(){
hide();
}, 1500);
// Error downloading the updates
}, function(progress) {
show('Download progress...' + progress);
// setTimeout(function(){
// hide();
// }, 5000);
// Do something with the download progress
// $scope.download_progress = progress;
});
}
},
function(error) {
// Error checking for updates
show('Error checking for updates');
setTimeout(function(){
hide();
}, 1500);
});
});
})
We've seen this error when downloading updates through Ionic Deploy before, and to the best of my knowledge it's caused by either an outdated version of the javascript component (ionic-service-deploy
) or the Cordova plugin (com.ionic.deploy
).
I think your best course of action would be to update both to the latest version with:
$ ionic plugin add https://github.com/driftyco/ionic-plugins-deploy
$ ionic add ionic-service-deploy
then run:
$ ionic platform remove android
$ ionic platform add android
$ ionic build android
to ensure no old versions of the plugin are cached.
Another possibility; you may have the plugin installed under the id com.ionic.update
(You can check this with $ cordova plugins list
). In this case, you can fix this by running:
$ cordova plugin remove com.ionic.update
$ ionic plugin add https://github.com/driftyco/ionic-plugins-deploy