更新时的cordova代码推送错误

时间:2016-11-14 16:36:38

标签: cordova ionic2 code-push

我在我的离子应用程序(https://github.com/Microsoft/cordova-plugin-code-push)中使用Cordova插件进行Microsoft Code Push服务。

目前我构建了一个Android应用[import yahoo_finance ticker = 'GLD' begdate = '2014-11-11' enddate = '2016-11-11' data = yahoo_finance.Share('GLD') data1 = data.get_historical(begdate,enddate) gld_df = pd.DataFrame(data1) date_df = (list(gld_df["Date"])) adj_close_df = list(gld_df["Adj_Close"]) print(adj_close_df) plt.plot(adj_close_df,date_df) ],将该更新推送到代码推送[ionic build android],然后使用包含codepush同步的应用。我看到更新被识别,下载,并尝试安装但失败。有任何想法如何解决/修复?

code-push release-cordova ionic-atslogin-android -m android

从代码推送调试:

11-14 10:25:32.684  4401  4401 I chromium: [INFO:CONSOLE(36)] "[CodePush] Package download success: {"deploymentKey":"KEY-HERE","description":"","label":"v8","appVersion":"0.0.1","isMandatory":true,"packageHash":"9bf0fcb79157619cf1eded10c3de186a7aeb2f4b02e96ef094886f429cdc0ef4","isFirstRun":false,"failedInstall":false,"localPath":"cdvfile://localhost/files/codepush/download/update.zip"}", source: file:///android_asset/www/plugins/cordova-plugin-code-push/bin/www/codePushUtil.js (36)
11-14 10:25:32.685  4401  4401 I chromium: [INFO:CONSOLE(82045)] "8", source: file:///android_asset/www/build/main.js (82045)
11-14 10:25:32.686  4401  4401 I chromium: [INFO:CONSOLE(36)] "[CodePush] Installing update", source: file:///android_asset/www/plugins/cordova-plugin-code-push/bin/www/codePushUtil.js (36)
11-14 10:25:33.134  4401  4401 I chromium: [INFO:CONSOLE(40)] "[CodePush]  Cannot perform diff-update.", source: file:///android_asset/www/plugins/cordova-plugin-code-push/bin/www/codePushUtil.js (40)
11-14 10:25:33.134  4401  4401 I chromium: [INFO:CONSOLE(40)] "[CodePush] An error occurred during sync.", source: file:///android_asset/www/plugins/cordova-plugin-code-push/bin/www/codePushUtil.js (40)
11-14 10:25:33.134  4401  4401 I chromium: [INFO:CONSOLE(82045)] "3", source: file:///android_asset/www/build/main.js (82045)

1 个答案:

答案 0 :(得分:0)

我认为这是由于我通过Ionic 2使用Sync的原因。这种同步逻辑似乎有效:

const downloadProgress = (progress) => { console.log(`Downloaded ${progress.receivedBytes} of ${progress.totalBytes}`); }
CodePush.sync({updateDialog: true, installMode:InstallMode.IMMEDIATE, mandatoryInstallMode: InstallMode.IMMEDIATE}, downloadProgress).subscribe((syncStatus) => console.log(syncStatus));