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

Bug Addressables not loading in build

Discussion in 'Addressables' started by LuGus-Jan, Jul 5, 2020.

Thread Status:
Not open for further replies.
  1. Redmarian

    Redmarian

    Joined:
    Jul 6, 2017
    Posts:
    8
    I reverted to 1.16.15 and updated the localization système to 0.10, and it seems to work better, for the localization at least.
    (I'm in Unity 2020.2.1f1)
     
  2. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    Hey all, this is really interesting. I know we'd looked into this some but had a hard time reproducing the issue. I'm going to start digging into this myself and see if I can find out any information. I'll try and look up what's changed in those versions that might be causing this. I'm glad upgrading the 1.17.4-preview appears to fix it for some of you. The issue brought up by @sameng is very odd.

    if 1.16.15 appears to be the last version that stably works for everyone I'll have to see what changed after in both SBP and Addressables. I think in 1.15.2 of SBP there was only a minor change needed for some shader related tests if I remember correctly but I can double check all of that.

    As always, feel free to file bugs with your repro project if you're able. It helps us a lot. But, like I said, I'll see what I can find out.
     
  3. sameng

    sameng

    Joined:
    Oct 1, 2014
    Posts:
    172
    Thank you for taking a look at this!

    I tried to create a repro but couldn't. I copy pasted the same exact script and prefab loading, but I can't get it to break.
    My guess is that it is some sort of asset-related issue when it is building the catalog or bundle. I have 3+ GB of assets, so I'm really not sure what is breaking it.

    Also: there is no error.
    I am using InstantiateAsync, and the callback does run, but the Result is null.

    Code (CSharp):
    1.             var a = prefabAddressable.InstantiateAsync();
    2.             a.Completed += (c) => {
    3.                 Debug.Log(c.Result.name);
    4.             };

    At runtime, the Debug.Log throws null, as c.Result is null.
    Without the Debug.Log, it's a silent error: no error is thrown, but no gameobject is instantiated.


    Also, it doesn't matter what I put as prefabAddressable.
    I tried creating a new simple basic cube prefab addressable, but that still breaks it.

    Everything works perfectly in the Editor, even with use built groups setting. And it works with Build and Run--super weird.
     
  4. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,511
    Hopefully, this issue gets solved soon.
     
  5. einWikinger

    einWikinger

    Joined:
    Jul 30, 2013
    Posts:
    93
    Heya, we're suffering from the same issue. I made a diff of the catalogs of a working (addressables 1.16.15) and non-working (latest 1.17.4-preview) build and I found out that the bundle paths in the m_InternalIds array are totally different. Whereas the paths from 1.16.15 point, for example, to "{UnityEngine.AddressableAssets.Addressables.RuntimePath}/StandaloneWindows64/fonts_assets_all.bundle", the paths from 1.17.4-preview point to "Library/com.unity.addressables/aa/Windows/StandaloneWindows64\\fonts_assets_all.bundle". I assume this breaks inter-bundle dependency management and thus assets can't be loaded correctly anymore. I'm just puzzled that there are no errors raised that fail to find bundles etc.

    I had also diffed the source code of the involved packages and the only thing that struck me was the handling of "append hash" bundle naming that changed from one version to the other. We don't use it, so maybe this change broke how final dependent bundle paths are generated.
     
    chrismarch and MikeHergaarden like this.
  6. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    I just wanted to post a little update on here. I've spent some more time and I am having a rough time reproducing this issue. Unfortunately I only have access to a Windows machine so I'll have to get with someone that has a OSX machine to test on that. It's also quite possible I'm doing something wrong.

    I know asking to file bugs gets kind of old but it really will help if everyone that has this problem files a bug. It really does help us to get multiple projects to reproduce the issue. Typically I imagine you all have slightly different steps that are causing the issue and some of those might help us as well.

    I just wanted to post this to let you all know that we're not brushing this off. There's obviously a very legitimate bug you all are hitting but until we can reproduce it we're at a bit of a loss.
     
    MikeHergaarden and JesseSTG like this.
  7. einWikinger

    einWikinger

    Joined:
    Jul 30, 2013
    Posts:
    93
  8. wyattwww

    wyattwww

    Joined:
    Nov 14, 2015
    Posts:
    1
    @davidla_unity I also found the same issue reproducible even with Addressables 1.16.15 with SBP 1.15.1 in Unity 2020.2.x. The error does not happen with Unity 2020.1.x and earlier using Addressables 1.16.15 with SBP 1.15.1.

    The error appears to be related to specific assets. To troubleshoot, I added debug logging in
    the method CreateSubAssetLoadInfo in GenerateSubAssetPathMaps.cs to inspect assetInfo and subAsset to catch the bad index. Once I was able to identify the problematic asset and its dependencies, removing it from addressables will make the build succeed again.

    Nothing is different with the assets between upgrades of Unity and Addressables and everything works in the Editor and play mode. Just fails to get the proper index in CreateSubAssetLoadInfo.

    Edit: MacOS Catalina, build fails for both Android and iOS platforms.
     
    Last edited: Feb 5, 2021
  9. MartinTwinDrums

    MartinTwinDrums

    Joined:
    Jan 18, 2021
    Posts:
    14
    I have encounter the same issue using Adressables 1.16.15 in a Linux player build (mac and windows seems to work fine).

    Mac OS 10.15.7
    Unity 2020.2.1f1
    Adressables 1.16.15
    Linux build

    I will try 1.16.6 and the preview versions to check if one of the solves/changes the issue for me.
    Update: I tested 1.16.6 and 1.17.4 and it did not fix it :(
     
    Last edited: Feb 5, 2021
  10. MartinTwinDrums

    MartinTwinDrums

    Joined:
    Jan 18, 2021
    Posts:
    14
    I managed to solve the issue. Using 1.17.4 I got an additional Exception in the debug output:

    Exception encountered in operation Resource<ResourceManagerRuntimeData>(settings.json), status=Failed, result= : Invalid path in TextDataProvider : '/home/twindrums/server-headless-0.00.01/server-headless-0.00_Data/StreamingAssets/aa/settings.json'.


    It was missing the settings.json file. The project uses the remote buildpath and the build process does not create a settings.json file in the RemoteBuildPath (I used the one from the LocalBuildPath).
     
  11. Zarkend

    Zarkend

    Joined:
    May 11, 2016
    Posts:
    28
    I'm having problem with this also. My build compiles correctly using the https://game.ci/ github actions, but when the game tries to initialize addressables, an error pops:

    RuntimeData is null. Please ensure you have built the correct Player Content.
     
  12. MartinTwinDrums

    MartinTwinDrums

    Joined:
    Jan 18, 2021
    Posts:
    14
    Turns out you can't have an aa directory in StreamingAssets, since the AddresablesPlayerBuildProcessor will remove it. *sigh*

    Can someone explain to me, why one needs the settings.json file for loading addressables from a catalog? What exactly is kept in that file? And why is it not handled correctly when building for a remote path?

    upload_2021-2-6_9-34-50.png
     
  13. Thermos

    Thermos

    Joined:
    Feb 23, 2015
    Posts:
    148
    Upgrade from unity2020.1, addressable 1.16.15 => unity2020.2.3f1, addressable 1.16.16, clear all cache, rebuild addressable, build windows player, when game start, addressable fails to load,

    Exception encountered in operation Resource<IAssetBundleResource>(logo.bundle), status=Failed, result= : Invalid path in AssetBundleProvider: 'Library/com.unity.addressables/aa/Windows/StandaloneWindows64\scenes_scenes_scene/logo.bundle'.

    Seems like addressable is using local build path instead of local load path in player.


    Edit:
    opened up catalog.json

    "m_InternalIds":["Library/com.unity.addressables/aa/

    seems all internal ids have been replaced by local build path. may be a bug of SBP 1.15.2?
     
    Last edited: Feb 7, 2021
    einWikinger and pdinklag like this.
  14. pdinklag

    pdinklag

    Joined:
    Jan 24, 2017
    Posts:
    143
    Same issue here after updating to 1.16.16 (and SBP 1.15.2). This issue didn't exist in 1.16.15 with SBP 1.15.1 as I just used that yesterday.

    EDIT: I downgraded back to 1.16.15 (plus cache cleanup) and now it's all working again.
     
    Last edited: Feb 7, 2021
  15. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    Thanks everyone for posting the info and filing bugs. We'll use all this to get a repro going and hopefully get this resolved. We're still working on it. I wish I had better news to share but I wanted to post at least something so everyone would know where we're at.
     
  16. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    So, I have some maybe good news. Thanks to the project provided by @einWikinger I was able to get the issue to reproduce consistently on 1.17.4-preview. I updated to 1.17.5-preview (a version not currently public) and the issue went away. It was consistently reproducing on 1.17.4 so I'm holding out hope this is resolved, at least for some, in 1.17.5. I'll have to dig up what exactly changed this patch to see if something appears relevant. I'm going to work today to get that promoted publicly, though it may not actually be public for a couple of days.

    I'll post on this thread when the new version should be public so you all can give it a try. Also, just as a side note to anyone that tries 1.17.5-preview, be sure to rebuild your player content after updating versions. If you still experience the issue please let us know and post all the info you can so we can dig more into it.

    EDIT: yeah so there is a fix that is coming out in the next release that appears relevant to this issue. Hopefully it's a fix for everyone but at the very least it should help a lot
     
    Last edited: Feb 11, 2021
  17. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    I've just been informed 1.17.5-preview has gone live. Please give it a shot if you're having this issue. Please be sure to re-build your player content with the new version before building a new player.

    Let me know if there are still issues. Thanks!
     
    einWikinger, JesseSTG and LuGus-Jan like this.
  18. JesseSTG

    JesseSTG

    Joined:
    Jan 10, 2019
    Posts:
    236
  19. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    JesseSTG likes this.
  20. einWikinger

    einWikinger

    Joined:
    Jul 30, 2013
    Posts:
    93
    Issues in our production project have been solved for us with this update as well, thanks!
     
  21. SinedDV

    SinedDV

    Joined:
    Sep 23, 2020
    Posts:
    9
    Hello! The problem is present in Unity version 2019.4.20f1, Addressables package 1.17.5-preview.

    blob:file:///5f3b9122-284a-43b8-8c5d-377ce5e98f1e:8 Exception encountered in operation Resource<ResourceManagerRuntimeData>(settings.json), status=Failed, result= : TextDataProvider unable to load from url file:///D:/!OpenSpace/Development/BuildResult/StreamingAssets/aa/settings.json, result='HTTP/1.1 0 Unknown HTTP status'.
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)


    _JS_Log_Dump @ blob:file:///5f3b9122-284a-43b8-8c5d-377ce5e98f1e:8
    blob:file:///5f3b9122-284a-43b8-8c5d-377ce5e98f1e:8 RuntimeData is null. Please ensure you have built the correct Player Content.
    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    The error occurs in the generated application. UnityInstance just doesn't see built-in Addressables. Cleaning and building Addressables does not affect the result. Below is a link to a simple project where you can reproduce the error while building your application. Everything works in the editor, there is localization.
    https://drive.google.com/file/d/19qxbMwwHaQNL5xgUiTp9fDAUgwI39Xts/view?usp=sharing
     
  22. SinedDV

    SinedDV

    Joined:
    Sep 23, 2020
    Posts:
    9
  23. caardappel-hbs

    caardappel-hbs

    Joined:
    Mar 15, 2013
    Posts:
    5
    I am still getting a null type in the uniqueTypes list that is getting built in ExtensionMethods.ExtractCommonCacheData.

    This does not occur in Unity 2019, but does in 2020; even with the latest (1.17.6-preview) addressables.

     
  24. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    @caardappel-hbs interesting that the Unity Editor version matters. I mean the stack trace indicates that there's either a bug in SBP or there's a bug in that version of the editor that SBP is so happens hitting. There's a new version of SBP coming out alongside Addressables in a couple days so you could give that a try but I'm not seeing anything in the upcoming SBP changelog that looks like it will help. I'd definitely file a bug for that team to look at.

    @SinedDV Have you filed a bug? Thanks for providing that project. I'll give that a look.
     
    wirelessdreamer likes this.
  25. wirelessdreamer

    wirelessdreamer

    Joined:
    Apr 13, 2016
    Posts:
    134
    Unity 2019.4.8.f1 with 1.16.15 I had addressables issues that midproject surfaced. I just updated to 1.17.6-preview and made a working build
     
  26. mailfromthewilds

    mailfromthewilds

    Joined:
    Jan 31, 2020
    Posts:
    215
    i get this bug sometimes, like few times a day, i ahve to rebuild and recompile and then it works
     
  27. Clauvin

    Clauvin

    Joined:
    Jan 26, 2018
    Posts:
    2
    Using Unity 2019.1.14f1 and Addressables 1.17.13, bug still happening:

    Exception encountered in operation Resource<ResourceManagerRuntimeData>(settings.json), status=Failed, result= : Invalid path in TextDataProvider : 'C:/Users/etc/Downloads/Gatch v4.20210320/Gatch_Data/StreamingAssets/aa/settings.json'.

    Will try to update the project to the latest LTS and see if the bug is solved there.
     
  28. Clauvin

    Clauvin

    Joined:
    Jan 26, 2018
    Posts:
    2
    Bug fixed after I updated the project to Unity 2019.4.22f1.
     
    davidla_unity likes this.
  29. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    That's very odd to me that the Editor version mattered but I'm glad the issue was resolved for you @Clauvin

    If anyone is still having the original issue posted you can try updating your editor or try updating the package version (1.17.15 is the newest at the time of writing). If you're still having issues please feel free to file a bug.

    If your issue seems similar but not exactly the same and you'd like to discuss it more go ahead and start a new thread for discussion.
     
  30. gabagpereira

    gabagpereira

    Joined:
    Jan 21, 2019
    Posts:
    23
    It's my first time working with Addressables and I faced the same problem when exporting both for Android and Windows.

    However, updating the package to version 1.17.15, as @davidla_unity suggested, solved the issue!

    I'm using Unity 2019.4.20f1 at the moment.
     
  31. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,796
    As the original issue in this thread has been resolved, I'm going to lock it down. If anyone has a similar issue, please create a new thread.
     
Thread Status:
Not open for further replies.