After Hot Update, file not found issue

@Randomzord, @pandamicro, @huanxinyin,

hi,
i downloaded some files through hot update and upon restarting i got a black screen right at the start(and error in the logs). i am trying to resolve the issue and i have the following questions…

  1. Why did the black screen it come? Did it come because of the error?Here are the logs…

10-17 18:47:13.775 17743 17743 I jswrapper: intent not null

10-17 18:47:13.775 17743 17743 I jswrapper: action not null

10-17 18:47:13.779 17743 17743 I jswrapper: location getLastKnownLoaction started

10-17 18:47:13.790 17743 17743 I jswrapper: location perimssion not granted

10-17 18:47:13.875 17743 17776 D jswrapper: Initializing V8, version: 7.5.288.30

10-17 18:47:13.961 17743 17776 D jswrapper: JS: Enable batch GL commands optimization!

10-17 18:47:14.534 17743 17776 D jswrapper: JS: ****_packageUrl : https://www.playproject.com/gameassets/temp/projectv3/

10-17 18:47:14.534 17743 17776 D jswrapper: JS: ****_version : 6.004.001

10-17 18:47:14.534 17743 17776 D jswrapper: JS: JS Custom Version Compare: version A is 5.002.001, version B is 6.004.001

10-17 18:47:14.552 17743 17776 E jswrapper: ScriptEngine::onGetStringFromFile ./jsb-dragonbones.js not found, possible missing file.

10-17 18:47:14.552 17743 17776 E jswrapper: ScriptEngine::runScript script ./jsb-dragonbones.js, buffer is empty!

10-17 18:47:14.552 17743 17776 E jswrapper: [ERROR] Failed to invoke require, location: /Users/hd/project/build/jsb-default/frameworks/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_global.cpp:300

10-17 18:47:14.560 17743 17776 E jswrapper: ScriptEngine::onGetStringFromFile ./jsb-spine-skeleton.js not found, possible missing file.

10-17 18:47:14.560 17743 17776 E jswrapper: ScriptEngine::runScript script ./jsb-spine-skeleton.js, buffer is empty!

10-17 18:47:14.560 17743 17776 E jswrapper: [ERROR] Failed to invoke require, location: /Users/hd/project/build/jsb-default/frameworks/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_global.cpp:300

10-17 18:47:14.641 17743 17776 D jswrapper: JS: Cocos Creator v2.3.4

10-17 18:47:15.084 17743 17776 E jswrapper: [ERROR] (/Users/hd/project/build/jsb-default/frameworks/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_global.cpp, 950): File (res/raw-assets/0f/0f89816e-0988-497a-94a3-541207dece15.png) doesn’t exist!

10-17 18:47:15.084 17743 17776 E jswrapper: [ERROR] Failed to invoke js_loadImage, location: /Users/hd/project/build/jsb-default/frameworks/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_global.cpp:977

  1. We have already put checks that restart only when download is successful(see code below). Black screen came despite those checks. How can we verify whether download is successful or whether there is an error?

switch (event.getEventCode())
{
case jsb.EventAssetsManager.UPDATE_FINISHED:
console.log('Update finished. ’ + event.getMessage());
needRestart = true;
break;

  1. Where in the code are these logs so that we can debug ourselves. Also, what do these logs mean and when is this code called? Does it indeed mean that the particular file wasn’t downloaded, or wasn’t downloaded properly(despite the checks???) ?

Please help me resolve this issue. My cocos creator version is 2.3.3.

Thanks!

By the errors, looks like you are missing files, if you could share the project would be great, but if you don’t, try look at these:

1 - Cocos creator version mismatch:
| - You are using some build template / old build folder that has an different version of the project that the one that you are currently using. Hot update is really sensible with different Cocos versions (Ex. base app 2.4.1, remote assets 2.4.3), in some cases it work, most of them it will not. Just to be sure, assume not.

2 - Not all files are being correctly versioned:
| - In older versions of CC (I’m used to 1.9.3), if the file was not on the hot update files, but it is present in the base app, it will use the base version. I’m not sure if this still is the case, but to the sure, versione (versionate? to version) even the files that you are sure that will not change.

I think that this is what I can help you with for now

hi,
i would like to add that with a normal network connection hot update is working fine but when the network fluctuates during asset download then i encounter the issue of file not found after restart.
so, i don’t think your point 1 or 2 are the issue here.

The logs say:

10-17 18:47:15.084 17743 17776 E jswrapper: [ERROR] (/Users/hd/project/build/jsb-default/frameworks/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_global.cpp, 950): File (res/raw-assets/0f/0f89816e-0988-497a-94a3-541207dece15.png) doesn’t exist!

this asset was introduced in the update but upon launch the app wasn’t able to find it.
my cocos creator version is 2.3.3
this problem is only coming when the network connection is unstable.
how can i fix this problem?
thanks!

That’s one of the things that are in my To Do list for years now :laughing:

I know that Hot Update can identify those files, and has an option to retry, but I never tried it. Good luck and when you find out how to do it, please share :grin:

Maybe someone from cocos team can help us in this. @slackmoehrle if possible can you please have a look at this.

I would be happy to ask a member of the engineering team to take a look.