ScottVan
ScottVan
  • 发布:2017-02-09 04:52
  • 更新:2017-02-09 04:52
  • 阅读:1095

APP更新出错“installWgt is not defined”

分类:HTML5+

APP更新出错,调试输出显示以下内容:

3 at index.html:179
3 at index.html:179
下载wgt成功:_doc/update/H51214219_0209035835(3).apk at index.html:169
Uncaught ReferenceError: installWgt is not defined at index.html:170

以下是APP更新相关代码:

if(newVer != plus.storage.getItem("versionInfo")) { //版本有更新
console.log("需要下载升级包");
plus.nativeUI.showWaiting("正在下载应用资源...");
//获取版本信息并检查更新
var dtask =plus.downloader.createDownload(updateUrl, {
filename: "_doc/update/"
}, function(d, status) {
if(status == 200) {
console.log("下载wgt成功:" + d.filename);
setTimeout(installWgt(d.filename, false), 2000); // 安装wgt包
} else {
console.log("下载wgt失败!");
plus.nativeUI.alert("下载wgt失败!");
}
plus.nativeUI.closeWaiting();
});
dtask.addEventListener("statechanged", function(task, status) {
console.log(task.state);
});
dtask.start();
}

dtask监听输出一直是3333333...没有输出4,但不可能是网络问题啊,APP2M多,几秒就下好了。
之前同样这段代码,在另一个APP上更新成功,不知道什么原因,求解。

2017-02-09 04:52 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复