我正在尝试离子部署。并且似乎一切正常,直到获得更新后再次加载应用程序。我提供了截图。如果我能提供其他任何东西,请告诉我。谢谢。
应用程序完成下载和解压缩后出现控制台错误,然后尝试再次加载。
我的网页浏览错误
部署脚本中load方法的离子源代码
我的javascript实现:
$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);
});
});
})

答案 0 :(得分:0)
我们之前通过Ionic Deploy下载更新时看到了这个错误,据我所知,它是由过时版本的javascript组件(ionic-service-deploy
)引起的,或者是Cordova插件(com.ionic.deploy
)。
我认为您最好的做法是将两者都更新到最新版本:
$ ionic plugin add https://github.com/driftyco/ionic-plugins-deploy
$ ionic add ionic-service-deploy
然后运行:
$ ionic platform remove android
$ ionic platform add android
$ ionic build android
确保没有缓存旧版本的插件。
另一种可能性;您可以在ID com.ionic.update
下安装插件(您可以使用$ cordova plugins list
进行检查)。在这种情况下,您可以通过运行:
$ cordova plugin remove com.ionic.update
$ ionic plugin add https://github.com/driftyco/ionic-plugins-deploy