Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Addressable assets can't be loaded on builds

Discussion in 'Addressables' started by caglarenes, Oct 14, 2022.

  1. caglarenes

    caglarenes

    Joined:
    Jul 9, 2015
    Posts:
    45
    Hello, I'm using Unity 2021.3.2f1. I'm trying to load my assets with Addressables. Everything works in editor with "Use Asset Database(fastest) or "Simulate Groups(advanced".

    But if I select "Use Existing Build(Android/Windows/iOS)" in editor or try with builded app on Android/Windows/iOS nothing works. There isn't any error on profiler, console etc. AsyncOperation just stucks at 0.

    If I waits AsyncOperation with WaitForCompletion() on editor, It's uses %100 CPU forever, which is strange.

    I tried with Addressables package 1.19.19 and 1.20.5. Nothing changed. I tried in Windows and OSX. Nothing changed. I can't change my Unity version because I stuck with this version especially for other IL2CPP bug.

    Thanks for your help.

    Here my code and addressable settings:
     

    Attached Files:

  2. KnuckleCracker

    KnuckleCracker

    Joined:
    Dec 27, 2011
    Posts:
    80
    Out of curiosity, did you do any LoadAssetAsync's followed by Addressables.Release before the call to LoadAssetAsync that 'hangs'?

    I have a case where I load a Texture2D, call WaitForCompletion, grab data from the texture after it loads, then I Addressables.Release that Texture2D... the next call to LoadAssetAsync().WaitForCompletion() will hang forever... but only in a build. Works fine in the editor.

    This may not be your case, but you weren't getting any replies so I thought I would mention it. In my case, I have to do all of the Release calls after I have done all of the LoadAssetAsync().WaitForCompletion() calls. I'm also using 1.20.5 and Unity 2022.2 beta.
     
  3. caglarenes

    caglarenes

    Joined:
    Jul 9, 2015
    Posts:
    45
    Thank for the tip :)

    But sadly, I'm not using any Addressables.Releases(). I only try to load my prefabs and sprites on start up loading process. Normally I listen callback for completion, I used WaitForCompletion only for curiosity.
     
  4. caglarenes

    caglarenes

    Joined:
    Jul 9, 2015
    Posts:
    45
    Okay, I found the problem. I don't know is it normal. I was trying to load async scene and stoped activation for loading scene. It was blocking addressable async loading. Async loading commands doesn't run parallel, they works like queue as I understand.
     
  5. Gnoblar_agency

    Gnoblar_agency

    Joined:
    Sep 20, 2012
    Posts:
    8
    @KnuckleCracker Did you ever find a reason for why the next call to LoadAssetAsync().WaitForCompletion() would hang forever?
    I am experiencing the exact same issue and was wondering if you found a fix that didn't involve delaying the Release call.
    I'm using Unity 2022.3.10 and Addressables 1.21.18 (issue also occurs on 1.19.19)

    This issue started for us when upgrading our Unity version.
     
    User414322 likes this.
  6. User414322

    User414322

    Joined:
    Jul 9, 2019
    Posts:
    27
    Having the same issue as the poster above.
     
  7. WilhemB

    WilhemB

    Joined:
    May 27, 2015
    Posts:
    2
    Same here, I updated to Unity 2021.3.13 and Addressables 1.19.19, and my loading times at startup have increased significantly.
     
  8. WilhemB

    WilhemB

    Joined:
    May 27, 2015
    Posts:
    2
  9. User414322

    User414322

    Joined:
    Jul 9, 2019
    Posts:
    27
    In my case, the issue was that I had a scene async loading, and I had paused its loading until my other async processes were done. As it turns out, pausing any async load process pauses them all, so I had created a dependency loop.
     
  10. AndyBlock

    AndyBlock

    Joined:
    Oct 12, 2016
    Posts:
    30
    We hit a similar issue after upgrading from 2021.3 to 2022.3; the problem turned out to be the same as the one described in https://issuetracker.unity3d.com/is...ne-asynchronously-and-using-waitforcompletion. We needed some addressables to be loaded synchronously on start up, so we were calling
    Addressables.LoadAssetAsync, then calling op.WaitForCompletion()... but this was happening in an Awake() which can apparently lead to a deadlock as described in that issue. Moving those calls to Start() was enough to solve it for us.