我正在使用Ionic 2的Ionic本机代码推送库。当我使用codepush部署应用程序时,应用程序(在Android上)下载更新但在安装时失败。导致问题的原因通常是什么?#34;无法计算包的散列"?
以下是我的日志:
[CodePush] Installing update
codePushUtil.js:36 [CodePush] Applying diff update
codePushUtil.js:36 [CodePush] Verifying hash for folder path: /codepush/deploy/versions/80577a164814d7e257b6e0cfac86890ee06b51617eb56d27d4fa8baf4af1a785/
codePushUtil.js:40 [CodePush] Unable to compute hash for package: An error occurred when trying to get the hash of the binary contents. invalid directory path /data/user/0/com.outplayed.tycho/files/codepush/deploy/versions/80577a164814d7e257b6e0cfac86890ee06b51617eb56d27d4fa8baf4af1a785/www
这是我在主ts文件中的代码:
constructor(public plt: Platform, private codePush: CodePush) {
if (this.plt.is('cordova')) {
// Don't run codepush in browser.
this.plt.ready().then((readySource) => {
const downloadProgress = (progress) => { console.log(`Downloaded ${progress.receivedBytes} of ${progress.totalBytes}`); }
this.codePush.sync({}, downloadProgress).subscribe((syncStatus) => console.log(syncStatus));
});
}
}