根据官方热更DEMO修改后遇到的问题,请官方帮忙看下

我下载官方热更DEMO工程移植代码到我的项目里,热更流程前一段没有问题,version.manifest,project.manifest都正确的下载了,对比出版本差异后,在对变动资源文件做下载的时候遇到了问题,导致热更失败。
出问题部分的代码:
updateCb: function (event) {
var needRestart = false;
var failed = false;
this.lblErr.string = ‘开始执行升级流程:.’;
console.log(‘111111111==>’);
switch (event.getEventCode())
{
case jsb.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST:
this.lblErr.string = ‘No local manifest file found, hot update skipped.’;
failed = true;
break;
case jsb.EventAssetsManager.UPDATE_PROGRESSION:
//this.panel.byteProgress.progress = event.getPercent() / 100;
//this.panel.fileProgress.progress = event.getPercentByFile() / 100;
console.log(‘222222==>getEventCode:’+event.getEventCode());
var msg = event.getMessage();
console.log(msg); //这里一直为空,获取不到进度信息~
if (msg) {
this.lblErr.string = ‘Updated file: ’ + msg;
this.percent.string = event.getPercent().toFixed(2)+’'; cc.log(event.getPercent().toFixed(2) + ' : ’ + msg);
}
break;
case jsb.EventAssetsManager.ERROR_DOWNLOAD_MANIFEST:
case jsb.EventAssetsManager.ERROR_PARSE_MANIFEST:
onsole.log(‘Fail to download manifest file==>1.5.1.5.1.5’);
this.lblErr.string = ‘Fail to download manifest file, hot update skipped.’;
failed = true;
break;
case jsb.EventAssetsManager.ALREADY_UP_TO_DATE:
onsole.log(‘ready==>2.1.1.1.2.1’);
this.lblErr.string = ‘Already up to date with the latest remote version.’;
failed = true;
break;
case jsb.EventAssetsManager.UPDATE_FINISHED:
console.log(‘END==>2.2.2.2.2’);
this.lblErr.string = 'Update finished. ’ + event.getMessage();
needRestart = true;
break;
case jsb.EventAssetsManager.UPDATE_FAILED:
console.log(‘2.52.5==>’);
this.lblErr.string = 'Update failed. ’ + event.getMessage();
////this.panel.retryBtn.active = true;
this._updating = false;
this._canRetry = true;
failed = true;
break;
case jsb.EventAssetsManager.ERROR_UPDATING:
this.lblErr.string = 'Asset update error: ’ + event.getAssetId() + ', ’ + event.getMessage();
break;
case jsb.EventAssetsManager.ERROR_DECOMPRESS:
console.log(‘333333==>’);
this.lblErr.string = event.getMessage();
break;
default:
break;
}

    if (failed) {
		console.log('44444==>');
        cc.eventManager.removeListener(this._updateListener);
		console.log('55555==>');
        this._updateListener = null;
        this._updating = false;
    }

    if (needRestart) {
		console.log('6666==>');
        cc.eventManager.removeListener(this._updateListener);
		console.log('77777==>');
        this._updateListener = null;  
        // Prepend the manifest's search path
        var searchPaths = jsb.fileUtils.getSearchPaths();
		console.log('88888==>');
        var newPaths = this._am.getLocalManifest().getSearchPaths();
        console.log(JSON.stringify(newPaths));
        Array.prototype.unshift(searchPaths, newPaths);
        // This value will be retrieved and appended to the default search path during game startup,
        // please refer to samples/js-tests/main.js for detailed usage.
        // !!! Re-add the search paths in main.js is very important, otherwise, new scripts won't take effect.
		console.log('88888==>'+searchPaths);
        cc.sys.localStorage.setItem('HotUpdateSearchPaths', JSON.stringify(searchPaths));
        console.log('9999999==>'+searchPaths);
        jsb.fileUtils.setSearchPaths(searchPaths);
		console.log('准备重启游戏==>'+searchPaths);
        cc.game.restart();
    }
},

这是相关日志:
05-24 16:29:59.998: E/cocos js error:(18335): assets/src/project.dev.js line:1378 msg:mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
05-24 16:30:00.238: D/cocos2d-x(18335): create rendererRecreatedListener for GLProgramState
05-24 16:30:00.338: D/cocos2d-x(18335): cocos2d: QuadCommand: resizing index size from [-1] to [2560]
05-24 16:30:00.338: D/FLQG_LOG(18335): Statistics: onActionResult(UserDebug,0,init success)
05-24 16:30:00.348: W/FLQG_LOG(18335): UserObject: callback of plugin UserDebug not set correctly
05-24 16:30:00.348: D/FLQG_LOG(18335): Statistics: onActionResult(CustomDebug,80000,CUSTOMRESULT_CUSTOMREXTENSION)
05-24 16:30:00.348: W/FLQG_LOG(18335): CustomObject: Listener of plugin CustomDebug not set correctly
05-24 16:30:00.348: D/FLQG_LOG(18335): Statistics: onActionResult(RECDebug,0,init success)
05-24 16:30:00.348: W/FLQG_LOG(18335): RECObject: Listener of plugin RECDebug not set correctly
05-24 16:30:00.908: D/cocos2d-x debug info(18335): Success to load scene: db://assets/resources/scenes/update.fire
05-24 16:30:00.918: D/cocos2d-x debug info(18335): Storage path for remote asset : /data/data/com.vivigames.scmj/files/scmj-remote-asset
05-24 16:30:00.918: D/cocos2d-x debug info(18335): Local manifest URL : res/raw-assets/project.manifest
05-24 16:30:00.938: D/cocos2d-x(18335): find in flash memory dirPath(/data/data/com.vivigames.scmj/files/scmj-remote-asset/)
05-24 16:30:00.938: D/cocos2d-x(18335): find in flash memory dirPath(/data/data/com.vivigames.scmj/files/scmj-remote-asset_temp/)
05-24 16:30:00.968: D/cocos2d-x debug info(18335): 创建资源管理对象成功
05-24 16:30:00.968: D/cocos2d-x debug info(18335): 准备检查···11
05-24 16:30:00.968: D/cocos2d-x debug info(18335): 开始检查···3333
05-24 16:30:00.968: D/cocos2d-x debug info(18335): 开始检查···4444
05-24 16:30:00.978: D/cocos2d-x debug info(18335): 开始检查···55555
05-24 16:30:00.978: D/cocos2d-x debug info(18335): 开始检查···6666
05-24 16:30:00.988: D/cocos2d-x debug info(18335): 开始检查···7777
05-24 16:30:00.988: D/cocos2d-x debug info(18335): 加载本地配置文件···222
05-24 16:30:00.988: D/cocos2d-x debug info(18335): 添加升级监听事件··444
05-24 16:30:00.988: D/cocos2d-x debug info(18335): 创建升级监听事件···5555
05-24 16:30:00.988: D/cocos2d-x debug info(18335): 开始检查升级···6666
05-24 16:30:00.988: D/cocos2d-x debug info(18335): 升级状态中···77777
05-24 16:30:00.988: D/cocos2d-x debug info(18335): 检查结束···9888888
05-24 16:30:00.998: D/TVM(18335): VMThread.create: new thread 18358
05-24 16:30:01.048: I/System.out(18335): entering allowSendingEmail
05-24 16:30:01.088: D/TVM(18335): GC_TIME GC_ALLOC freed 1822K, 58% free 1927K/4495K, objects(32573)
05-24 16:30:01.088: D/TVM(18335): try create PROXY:$Proxy0 by loader 0x4223cb20
05-24 16:30:01.118: D/Cocos2dxDownloader(18335): onSuccess(i:200 headers:[Lcz.msebera.android.httpclient.Header;@42254268 file:/data/data/com.vivigames.scmj/files/scmj-remote-asset_temp/version.manifest.tmp
05-24 16:30:01.118: D/cocos2d-x debug info(18335): Code: 5
05-24 16:30:01.118: D/cocos2d-x debug info(18335): JS Custom Version Compare: version A is 2.1.0, version B is 2.3.0
05-24 16:30:01.118: D/cocos2d-x debug info(18335): Code: 3
05-24 16:30:01.128: D/cocos2d-x debug info(18335): 准备升级···111
05-24 16:30:01.128: D/cocos2d-x debug info(18335): this._updating:false
05-24 16:30:01.128: D/cocos2d-x debug info(18335): [object AssetsManager]
05-24 16:30:01.128: D/cocos2d-x debug info(18335): 开始升级···2222
05-24 16:30:01.128: D/cocos2d-x debug info(18335): 激活升级端口···3333
05-24 16:30:01.128: D/cocos2d-x debug info(18335): 添加监听···4444
05-24 16:30:01.138: D/cocos2d-x debug info(18335): 更新文件···55555
05-24 16:30:01.158: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.158: D/cocos2d-x debug info(18335): 222222==>getEventCode:5
05-24 16:30:01.168: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.168: D/cocos2d-x debug info(18335): 222222==>getEventCode:5
05-24 16:30:01.168: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.168: D/cocos2d-x debug info(18335): 222222==>getEventCode:5
05-24 16:30:01.168: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.168: D/cocos2d-x debug info(18335): 222222==>getEventCode:5
05-24 16:30:01.248: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.248: D/cocos2d-x debug info(18335): 222222==>getEventCode:5
05-24 16:30:01.248: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.258: D/cocos2d-x debug info(18335): 222222==>getEventCode:5
05-24 16:30:01.258: D/Cocos2dxDownloader(18335): onSuccess(i:200 headers:[Lcz.msebera.android.httpclient.Header;@42266e30 file:/data/data/com.vivigames.scmj/files/scmj-remote-asset_temp/project.manifest.temp.tmp
05-24 16:30:01.268: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.268: D/cocos2d-x debug info(18335): 222222==>getEventCode:5
05-24 16:30:01.268: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.268: D/cocos2d-x debug info(18335): 222222==>getEventCode:5
05-24 16:30:01.268: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.268: D/cocos2d-x debug info(18335): 222222==>getEventCode:5
05-24 16:30:01.268: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.268: D/cocos2d-x debug info(18335): 222222==>getEventCode:5
05-24 16:30:01.268: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.268: D/cocos2d-x debug info(18335): 222222==>getEventCode:5
05-24 16:30:01.278: D/cocos2d-x debug info(18335): JS Custom Version Compare: version A is 2.1.0, version B is 2.3.0
05-24 16:30:01.278: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.288: D/cocos2d-x(18335): find in flash memory dirPath(/data/data/com.vivigames.scmj/files/scmj-remote-asset_temp/)
05-24 16:30:01.308: D/cocos2d-x(18335): find in flash memory dirPath(/data/data/com.vivigames.scmj/files/scmj-remote-asset_temp)
05-24 16:30:01.308: D/cocos2d-x(18335): find in flash memory dirPath(/data/data/com.vivigames.scmj/files/scmj-remote-asset_temp)
05-24 16:30:01.308: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.308: D/cocos2d-x debug info(18335): 222222==>getEventCode:5
05-24 16:30:01.308: D/cocos2d-x debug info(18335): Start to update 3 files from remote package.
05-24 16:30:01.328: D/TVM(18335): GC_TIME GC_ALLOC freed 557K, 55% free 2123K/4687K, objects(32582)
05-24 16:30:01.328: D/TVM(18335): VMThread.create: new thread 18363
05-24 16:30:01.338: D/cocos2d-x debug info(18335): 0.00% : Start to update 3 files from remote package.
05-24 16:30:01.348: D/Cocos2dxDownloader(18335): onFailure(i:404 headers:[Lcz.msebera.android.httpclient.Header;@42285f20 throwable:cz.msebera.android.httpclient.client.HttpResponseException: Not Found file:/data/data/com.vivigames.scmj/files/scmj-remote-asset_temp/res%5Craw-assets%5Cproject.manifest.tmp
05-24 16:30:01.348: I/System.out(18335): entering allowSendingEmail
05-24 16:30:01.358: D/Cocos2dxDownloader(18335): onFailure(i:404 headers:[Lcz.msebera.android.httpclient.Header;@42251260 throwable:cz.msebera.android.httpclient.client.HttpResponseException: Not Found file:/data/data/com.vivigames.scmj/files/scmj-remote-asset_temp/src%5Cproject.dev.js.tmp
05-24 16:30:01.358: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.378: D/TVM(18335): GC_TIME GC_ALLOC freed 622K, 49% free 2409K/4687K, objects(32588)
05-24 16:30:01.388: D/cocos2d-x(18335): find in flash memory dirPath(/data/data/com.vivigames.scmj/files/scmj-remote-asset_temp)
05-24 16:30:01.388: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.398: D/TVM(18335): GC_TIME GC_ALLOC freed 1047K, 63% free 1960K/5199K, objects(32637)
05-24 16:30:01.408: D/Cocos2dxDownloader(18335): onFailure(i:404 headers:[Lcz.msebera.android.httpclient.Header;@422658e0 throwable:cz.msebera.android.httpclient.client.HttpResponseException: Not Found file:/data/data/com.vivigames.scmj/files/scmj-remote-asset_temp/res%5Cimport%5C03%5C0363491c-9b17-44d1-96e4-0c954f35c399.json.tmp
05-24 16:30:01.418: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.418: D/cocos2d-x debug info(18335): 222222==>getEventCode:5
05-24 16:30:01.418: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.428: D/TVM(18335): GC_TIME GC_ALLOC freed 935K, 63% free 1957K/5199K, objects(32565)
05-24 16:30:01.458: D/cocos2d-x debug info(18335): 111111111==>
05-24 16:30:01.458: D/cocos2d-x debug info(18335): 2.52.5==>
05-24 16:30:01.468: D/cocos2d-x debug info(18335): 44444==>
05-24 16:30:01.468: D/cocos2d-x debug info(18335): 55555==>
到这里就更新失败了~~

顶下,开发团队能帮忙看看吗~~~~就差一点成功了。

官方文档:http://forum.cocos.com/t/topic/45321/80

个人文档:”http://forum.cocos.com/t/cocos3-15/46211

补充是用的V1.4.2版本

@panda 呼叫下大神,瞟一眼帮忙看看问题~~~

。。。。还没解决,哪位高人帮帮忙啊~~

@panda @panda @panda @panda :12:

你用1.5版本的,可以成功的,用xcode下的模拟器方式测试通过

我下载的是仓库里1.42版的代码,version.manifest.文件可以下载,也对比出了版本差异,project.manifest也下载了,比较出了需要下载的更新的文件,但是在下载更新文件的时候就报Not Found file:/data/data/com.vivigames.scmj/files/scmj-remote-asset_temp/src%Cproject.dev.js等几个文件,不知道是没下载正确还是直接就没有下载,因为version.manifest文件都是正确下载的,远程下载路径应该没有问题。
onFailure(i:404 headers:这个错误不知道是报的找不到远程热更服务器上的文件,还是找不到本地文件。

大佬,解决了吗?我也碰到了这个问题

路径中的%5C的转义是\,应该是用/

我也遇到和你差不多的问题

看你的输出
[Lcz.msebera.android.httpclient.Header;@42266e30 file:/data/data/com.vivigames.scmj/files/scmj-remote-asset_temp/project.manifest.temp.tmp
热更时下载的文件后缀为temp.tmp

但尝试读取却失败的文件名后缀却是.tmp
[Lcz.msebera.android.httpclient.Header;@42285f20 throwable:cz.msebera.android.httpclient.client.HttpResponseException: Not Found file:/data/data/com.vivigames.scmj/files/scmj-remote-asset_temp/res%5Craw-assets%5Cproject.manifest.tmp

原因暂时还在找。。。很苦恼

搞定没有

从头开始 ->测试->失败->从头开始->测试->失败->从头开始
当初刚开始接某些渠道SDK的时候就那样 文档不清不楚 甚至个别商家 还有错的,当你重复了N次之后 慢慢熟悉了他的流程,然后你就会了

:joy:

熟悉是很熟悉了:sweat: 可是我这热更新重启后无效,看了两天各种帖子依然没有实质性进展

你好,我遇到和你一样的问题了, 请问你解决了吗?是什么原因造成的还记得吗?