Trying to call LoadResourceLocationsAsync() with list of deserialized AssetReferences

Hello.

I have tried to solve this myself and have scoured forums (including this forum) for a case like mine; If I had found one, I would not have posted a new thread.

I’m trying to get a list of ResourceLocations from LoadResourceLocationsAsync() by passing a list of AssetReferences as key objects into LoadResourceLocationsAsync():

 IEnumerator LoadRooms()
    {
        string path = Application.persistentDataPath + "/rooms.json";
        if (File.Exists(path))
        {
            string json = File.ReadAllText(path);
            RoomDatas roomDataArray = JsonUtility.FromJson<RoomDatas>(json);
            List<object> keys = new List<object>();
            foreach (RoomData roomData in roomDataArray.roomDatas)
            {
                keys.Add(new AssetReference(roomData.selfReference.ToString()));
            }
            keys.ForEach(r => Debug.Log(r));
            AsyncOperationHandle<IList<IResourceLocation>> locationsHandle = Addressables.LoadResourceLocationsAsync(keys);
            yield return locationsHandle;
            Debug.Log(locationsHandle.Result.Count);
            Debug.Log(locationsHandle.Result);
        }
   }

When this method is called, it spits out these logs:

[[6e10839428306664e81b60ebcde227fc]]
UnityEngine.Debug:Log (object)

[[1c84699159e40b94d8c19c5a22d2d1cd]]
UnityEngine.Debug:Log (object)

[[495947cc7ca55a54bb64d4913e822c3c]]
UnityEngine.Debug:Log (object)

[[1c84699159e40b94d8c19c5a22d2d1cd]]
UnityEngine.Debug:Log (object)

[[1c84699159e40b94d8c19c5a22d2d1cd]]
UnityEngine.Debug:Log (object)

0
UnityEngine.Debug:Log (object)

System.Collections.Generic.List`1[UnityEngine.ResourceManagement.ResourceLocations.IResourceLocation]
UnityEngine.Debug:Log (object)

The logs suggest to me that the AssetReference deserialization is working fine, and that I’m getting back the async handle, but that my AssetReferences are no good as keys for LoadResourceLocationsAsync().

Now, it’s not clear to me from Unity’s documentation, but I’ve seen enough posts from other users suggesting that AssetReferences are usable as keys for LoadResourceLocationsAsync() to assume it’s the case.

Given the code and logs in this post, can anyone tell me what I’m doing wrong? I’m out of ideas and have been trying to solve the broader problem of managing saved data at runtime for a couple of weeks now. I thought Addressables would be a relatively easy way to do so, but apparently I still don’t understand them well enough to use them.

Incidentally, I have rebuilt my Addressables group after each failed troubleshooting measure.

Nope, disregard everything I posted.

Besides using the locations handle incorrectly, my real problem was that my GUIDs were wrapped inexplicably in "[ ]"s. I am now serializing GUIDs directly and using them to construct AssetReferences rather than serializing the AssetReferences themselves.

Sorry to clutter the board. Apparently, I can’t delete the thread, but maybe someone else will learn from my mistake.