Search Unity

Question WebGL & Addressable Assets

Discussion in 'Web' started by SamueleSaviano, Aug 19, 2021.

  1. SamueleSaviano

    SamueleSaviano

    Joined:
    Jun 29, 2017
    Posts:
    2
    Hi everyone,

    I'm trying to make addressable assets work in my WebGL build.
    Everything works fine in the editor and also in my Android and Standalone builds, but when I try to use them on my WebGL build I get these errors:


    Error while downloading Asset Bundle: Failed to decompress data for the AssetBundle 'https://addressable.blob.core.windows.net/webgl/npc_assets_all_e4aebdea0aa6126d5a975ee0c45a1fc4.bundle'.




    Decompressing this format (1) is not supported on this platform.

    (Filename: ./Runtime/Utilities/Compression/Compression.cpp Line: 51)




    RemoteProviderException : Unable to load asset bundle from : https://addressable.blob.core.windows.net/webgl/npc_assets_all_e4aebdea0aa6126d5a975ee0c45a1fc4.bundle
    UnityWebRequest result : Received no data in response
    ResponseCode : 200, Method : GET
    url : https://addressable.blob.core.windows.net/webgl/npc_assets_all_e4aebdea0aa6126d5a975ee0c45a1fc4.bundle


    I'm storing my addressable files on Azure using blobs and I've already fixed all the CORS issues related to that.
     
  2. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,555
    You could try checking each group for the type of compression, then if nothing stands out try another option? ..or if you're building procedurally, you can set compression for groups like this:
    Code (CSharp):
    1. AddressableAssetSettings aaSettings = AddressableAssetSettingsDefaultObject.Settings;
    2. foreach (AddressableAssetGroup group in aaSettings.groups)
    3. {
    4.   BundledAssetGroupSchema schema = group.GetSchema<BundledAssetGroupSchema>();
    5.   schema.Compression = BundledAssetGroupSchema.BundleCompressionMode.LZ4;
    6. }
     
    SamueleSaviano likes this.
  3. SamueleSaviano

    SamueleSaviano

    Joined:
    Jun 29, 2017
    Posts:
    2
    I was actually building them using the LZMA compression. I've now tried both LZ4 and Uncompressed but I keep receiving the same errors.

    EDIT: I forgot to clear the site cache so that it was still using the cached groups. It works now with the LZ4 compression, thank you very much, you saved my day!
     
    Last edited: Aug 19, 2021
  4. SanghoonLim

    SanghoonLim

    Joined:
    May 17, 2022
    Posts:
    14
    I'm warding.
     
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    PastPresentFuture likes this.