Search Unity

Bug Key Issues with WebGL and remote Addressables

Discussion in 'Addressables' started by aetherborn_crypto, Dec 5, 2022.

  1. aetherborn_crypto

    aetherborn_crypto

    Joined:
    Dec 5, 2022
    Posts:
    1
    Hello,

    I'm running a test to play music with remote Addressables.

    Code (CSharp):
    1. using UnityEngine.AddressableAssets;
    2. using UnityEngine.ResourceManagement.AsyncOperations;
    3.  
    4.  
    5. public class AddressableTest : MonoBehaviour
    6. {
    7.     public static AddressableTest instance;
    8.     private GameObject musicHolder;
    9.     private MusicHandle mHandle;
    10.     public AssetReference assetReference;
    11.     private AudioSource source;
    12.  
    13.     // Start is called before the first frame update
    14.     void Awake()
    15.     {
    16.         instance = this;
    17.         AsyncOperationHandle<GameObject> asyncHandle = assetReference.LoadAssetAsync<GameObject>();
    18.         asyncHandle.Completed += Completed;
    19.         source = gameObject.AddComponent<AudioSource>();
    20.     }
    21.  
    22.     private void Completed(AsyncOperationHandle<GameObject> obj)
    23.     {
    24.         if (obj.Status == AsyncOperationStatus.Succeeded)
    25.         {
    26.             musicHolder = Instantiate(obj.Result);
    27.             mHandle = musicHolder.GetComponent<MusicHandle>();
    28.         }
    29.         else
    30.         {
    31.             Debug.LogError("failed to load music test" + obj.Result);
    32.         }
    33.     }
    34.  
    35.     public void PlayMusic(string URL)
    36.     {
    37.         source.loop = true;
    38.         source.clip = mHandle.GetAudioClip(URL);
    39.         source.Play();
    40.     }
    The Addressable Group and setting seems to be set up properly:



    But I'm getting:

    XML:
    <Error>
    <Code>NoSuchKey</Code>
    <Message>The specified key does not exist.</Message>
    <Details>No such object: crypto-raiders-assets/addressable_testsWebGL/catalog_2022.12.05.12.20.28.hash</Details>
    </Error>

    When I try to retrieve from WebGl in a test cloud build.

    Also the Unity Editor gives me this error in the console (Note that I do still have the setting for remote load path and not local, but still):

    UnityEngine.AddressableAssets.InvalidKeyException: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown. No MergeMode is set to merge the multiple keys requested. Keys=, Type=UnityEngine.GameObject
    UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])

    I would appreciate any help.