i downloaded the sample hot update project and made and android build of it. i then installed it on my android device and a popup came up. i clicked on the bottom left button on the popup and after some time a message appeared “Failed to download manifest file. Hot update skipped”. when i clicked on the bottom right button it disappeared. it seems the project is too old and the server side assets of the project have been removed. can someone fix this?
also, i had some questions…why is there a list of assets, both in hotupdate.js and in project.manifest? also i noticed that there are some assets in project.manifest that are not in hotupdate.js. is it so that they can be downloaded during hot update? can we update only some of the assets in the build?
how can i setup hot update on my local server? if i run version_generator.js then does the parameter after -s need to be the path to the unzipped apk that i generate(and then i will zip the folder and install it on the device)? if not so, then what does the parameter after -s need to be?
also, do i have to run version_generator.js on my computer to generate the manifest for the client side build? or do i have to run version_generator.js on the server to generate the manifest for the server side build? or do i have to run it in both places?
Too many questions, some of them can be answered by reading the documentation, so I will explain some macro concept/work of the hot update.
What Hot Update does is similar to a rsync unix command, it will see the different between you local manifest (usually a file, but in the example it is hardcoded in hotupdate.js), and the remote manifest file. First, for performance, it will only compare the versions.
If the remote is greater than the local, it will make the local files became the same as the remote file. Deleting the ones that are no longer present in the remote, downloading and adding the new files, download and overtiring the modified ones. (It is not exactly like that, but this is the concept).
the version_generator.js is the script that will create the remote files manifest. It is better to understand what it does and modify it, the exemple one, for me, it is not fine. Has too many modification options (what is good), but can be more powerful (and need to be modified according to your project’s design).
If you stuck at hot update, try to hack game engine,
I have written a sample in xamarin platform, just convert it to native platform:
thanks for the reply…but i still have one basic question…let’s say we are not using the customManifestStr in hotupdate.js and instead use the project.manifest in the assets folder as the client manifest.
then, do we:
- since the project.manifest will go in the assets folder, in hotupdate.js, in the script we should refer to the project.manifest with the proper path.
- make an apk of the project without the project.manifest?
- unzip the apk
- then make the project.manifest using the version_generator.js.
- then put the project.manifest in the assets folder.
- then make the build again.
- then install it on the device.
please tell me if the points are right?
Before I start, one thing that I did not make it clear in my previous post:
YES, THE TUTORIAL IS BROKEN AND IT SHOULD BE FIXED ASAP!!! One of the feature keys of the 2.4 update was that Hot Update was improved, but it didn’t say how or what, and didn’t make any new example.
Before 2.0, the build folder keeped the same file structure as the project, so you could refer an dummy manifest file and it would be changed with an actual updated manifest between the build and compile processes.
But, in 2.x, the files names are modified to an UUID, and retrieve this info is not that easy, and in 2.4 with bundles it was even more. So, what I did was, I copy the local manifest into the assets/main folder on the build, and create a asset manager with this path hardcoded, something like
let manifestUrl= "assets/main/project.manifest"; this._am = new jsb.AssetsManager(manifestUrl, storagePath, versionCompareHandle);
Again, just to be clear, the to make the manifest file is between build and compile, so you don’t need to make any changes in the apk itself
thanks for the reply!
and what do i do with this line of code?
var url = this.manifestUrl.nativeUrl;
i mean manifestUrl needs to be a member variable of the class, and doesn’t it need to be of type cc.Asset?
how do you make sure the project.manifest gets updated?
Ignore/remove it. It was if you could reach and/or modify the local manifest file, but you can’t.
AFAIK, when the hot update ends, it changes the local version of the manifest with the remote one, so after the download, when you load your local version, is the updated one.