Hi!
I can’t seem to find any hint on how to solve this issue in WebGL when I load an assetbundle.
I get the following error: Unable to read header from archive file: “the location of the file in IndexedDB”
The asset bundles are compressed using LZ4 and I use LoadFromFileAsync(), loading them works fine in editor, windows player etc…
I am using 2018.4.2f1 version of unity.
If anyone has the slightest idea on why this could be, please share it with me because I simply can’t find anything on the web about this issue. Thanks!
Anyone? I’ve tried also with uncompressed asset bundles, I’ve tried using LoadFromMemoryAsync(), LoadFromStreamAsync()… I just can’t manage to load bundles saved in IndexedDB.
Putting the bundles in the StreamingAssets folder of the WebGL build directory and loading using UnityWebRequestAssetBundle.GetAssetBundle(path)) seems to work.
Is it not possible to load asset bundles from IndexedDB or am I missing something?
I solved the issue.
For anyone who may encounter the same issue: I was downloading the asset bundles from a server and was using DownloadHandlerFile to store the bundle in the persistant data path. For some reason in webgl it was writing an empty file, that’s why it was unable to load it.
Now I use the default downloadHandler class and get the bytes array and write it to file with File.WriteAllBytes().
To load the asset bundle I use the following:
var bytes = File.ReadAllBytes(file);
AssetBundleCreateRequest = AssetBundle.LoadFromMemoryAsync(bytes);
4 Likes