Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Remote addressables work fine in local builds, fail in Unity Cloud Build

Discussion in 'Addressables' started by vbl-public, Feb 21, 2022.

  1. vbl-public

    vbl-public

    Joined:
    Feb 16, 2022
    Posts:
    3
    Wondering if I'm missing something obvious. I have some assets marked as addressable which I load via script either from their AssetReference or by their string location. I do the following steps to get the files set up:
    1. Build the addressables with Remote Catalog turned on with the RemoteLoadPath set to my data server
    2. Copy the ServerData/ folder to my remote host
    3. Test in the editor that Play Mode > Use Existing Build loads the data (this works)
    4. Build a desktop standalone, test that this loads the data (this also works)
    5. Push the entire project to github as-is, caveat: files that I load from the addressables system using their string path are ignored and not pushed to github.
    6. Build on Unity Cloud Build, download the successful build, this does not load any of the remote addressable assets and throws these errors at the top of the log:
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2.   at Unity.Scenes.ResourceCatalogData.GetGUIDFromPath (System.String path) [0x00096] in <da00da026fd34dbcbe73e669c3a12f0f>:0
    3.   at Unity.Scenes.SceneSystem.GetSceneGUID (System.String scenePath) [0x0000b] in <da00da026fd34dbcbe73e669c3a12f0f>:0
    4.   at Unity.Scenes.GameObjectSceneUtility.AddGameObjectSceneReferences () [0x00034] in <da00da026fd34dbcbe73e669c3a12f0f>:0
    5.   at Unity.Entities.AutomaticWorldBootstrap.Initialize () [0x0000c] in <d85749404aaa4a34a54e17f2a8a01642>:0
    And this error:
    Code (CSharp):
    1. System.Exception: Invalid path in TextDataProvider : 'C:/Users/.../.../win64_Data/StreamingAssets/aa/settings.json'.
    2. RuntimeData is null.  Please ensure you have built the correct Player Content.
    3. Addressables - Unable to load runtime data at location UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[[UnityEngine.AddressableAssets.Initialization.ResourceManagerRuntimeData, Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]].
    4. OperationException : Addressables - Unable to load runtime data at location UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[[UnityEngine.AddressableAssets.Initialization.ResourceManagerRuntimeData, Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]].
    5. UnityEngine.AddressableAssets.InvalidKeyException: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=523f4b2aa92687c4ca463a70e7e8fdd2, Type=UnityEngine.TextAsset
    6. UnityEngine.AddressableAssets.InvalidKeyException: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=b33a20021d8fc0f4cbe0a9c7852ca429, Type=UnityEngine.TextAsset
    7. UnityEngine.AddressableAssets.InvalidKeyException: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=eebd455733d6e214398d5c6482fff5bf, Type=UnityEngine.TextAsset
    8. UnityEngine.AddressableAssets.InvalidKeyException: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=3a7961a807fd6bf42adead676a80dabf, Type=UnityEngine.TextAsset
    9.  
    Is the problem that I have to include the addressable assets in the build folder, even though they are only ever loaded from the built addressable asset bundle by path? I was under the impression that you didn't need to do this because other threads explain how to build addressable asset bundles in other projects and then load these by path. I'm trying to avoid pushing these large files to github.

    I'm sure I'm doing something stupid here but I'm finding Addressables extremely confusing. Any help would be much appreciated.
     
    Last edited: Feb 21, 2022
  2. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
    Hi @danbirman-uw the "aa" contains local Addressables content. One of the files in the folder is the settings.json file, which is a special file needed to initialize the Addressables system. More info can be found here: https://docs.unity3d.com/Packages/com.unity.addressables@1.19/manual/Builds.html#build-artifacts

    When building the player, the "aa" folder gets copied from the Library/com.unity.addressables to the Assets/StreamingAssets folder. There's a known issue where the "aa" folder can sometimes fail to be copied, which will be fixed the next package release. For now the workaround is to manually copy the "aa" folder to StreamingAssets, or you can try rebuilding Addressables.

    Regarding the null exception, I'm assuming since the settings.json failed to load, any subsequent calls to load Addressables content would fail. Also since you're also using the entities package, make sure that you are only marking Unity types compatible with DOTS (mesh, material, textures, etc.) as addressable.
     
    WaqasGameDev likes this.
  3. WaqasGameDev

    WaqasGameDev

    Joined:
    Apr 17, 2020
    Posts:
    118
    Very interesting. For me, android build was not loading any of the remote assets and it was giving me runtime data is null error. Initially I fixed the problem through this solution proposed by unity_bill,
    https://forum.unity.com/threads/editor-unable-to-load-runtime-data-at-location.726560/

    But after a day, it was again causing similar problem. So this solution worked perfectly to solve the issue.
     
    pillakirsten likes this.
  4. kogi_rc

    kogi_rc

    Joined:
    Apr 23, 2019
    Posts:
    39
    Hello, sorry for reviving an old thread but is there a issue tracker link for this issue? I'm still getting this problem sometimes in the most recent AA version where "aa" folder is simply missing from the final build. Not sure if this is the same thing or maybe something else.

    edit: nvm, it seems that even Library/com.unity.addressables is missing completely because for some reason CLI build doesn't build addressables so it's not the same thing. Really annoying because it only started happening randomly in the latest version but previous version was wasting 10 minutes for a series of stack overflows so basically by updating addressables I traded slower builds for faster builds but they sometimes don't work at all during runtime.

    edit2: started new thread here https://forum.unity.com/threads/are...ddressableassetsettingsdefaultobject.1317441/ because that issue seems unrelated to this topic
     
    Last edited: Aug 2, 2022