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

Getting exception with Addressables since 1.2.2

Discussion in 'Addressables' started by Glaswyll, Sep 21, 2019.

  1. Glaswyll

    Glaswyll

    Joined:
    Feb 13, 2014
    Posts:
    103
    I keep having to revert to 1.1.10 due to this. It's happened in 1.2.2, 1.2.3 and 1.2.4.

    Code (CSharp):
    1. Exception encountered in operation UnityEngine.AddressableAssets.Initialization.InitializationOperation, result='', status='Succeeded' - Chain<AudioMixer,IResourceLocator>: ChainOperation of Type: UnityEngine.Audio.AudioMixer failed because dependent operation failed
    2. Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=c1aeda1c0be902246b83560ee3bdad45
    3. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    4. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    5. UnityEngine.Logger:LogFormat(LogType, String, Object[])
    6. UnityEngine.Debug:LogErrorFormat(String, Object[])
    7. UnityEngine.AddressableAssets.AddressablesImpl:LogException(AsyncOperationHandle, Exception) (at {Project_Path}\Library\PackageCache\com.unity.addressables@1.2.4\Runtime\AddressablesImpl.cs:150)
    8. UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:set_OperationException(Exception) (at {Project_Path}\Library\PackageCache\com.unity.addressables@1.2.4\Runtime\ResourceManager\AsyncOperations\AsyncOperationBase.cs:278)
    9. UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:Complete(AudioMixer, Boolean, String) (at {Project_Path}\Library\PackageCache\com.unity.addressables@1.2.4\Runtime\ResourceManager\AsyncOperations\AsyncOperationBase.cs:362)
    10. UnityEngine.ResourceManagement.ChainOperation`2:OnWrappedCompleted(AsyncOperationHandle`1) (at {Project_Path}\Library\PackageCache\com.unity.addressables@1.2.4\Runtime\ResourceManager\AsyncOperations\ChainOperation.cs:44)
    11. DelegateList`1:Invoke(AsyncOperationHandle`1) (at {Project_Path}\Library\PackageCache\com.unity.addressables@1.2.4\Runtime\ResourceManager\Util\DelegateList.cs:69)
    12. UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:InvokeCompletionEvent() (at {Project_Path}\Library\PackageCache\com.unity.addressables@1.2.4\Runtime\ResourceManager\AsyncOperations\AsyncOperationBase.cs:314)
    13. UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:UnityEngine.ResourceManagement.AsyncOperations.IAsyncOperation.InvokeCompletionEvent() (at {Project_Path}\Library\PackageCache\com.unity.addressables@1.2.4\Runtime\ResourceManager\AsyncOperations\AsyncOperationBase.cs:452)
    14. UnityEngine.ResourceManagement.ResourceManager:ExecuteDeferredCallbacks() (at {Project_Path}\Library\PackageCache\com.unity.addressables@1.2.4\Runtime\ResourceManager\ResourceManager.cs:751)
    15. UnityEngine.ResourceManagement.ResourceManager:Update(Single) (at {Project_Path}\Library\PackageCache\com.unity.addressables@1.2.4\Runtime\ResourceManager\ResourceManager.cs:778)
    16. MonoBehaviourCallbackHooks:Update() (at {Project_Path}\Library\PackageCache\com.unity.addressables@1.2.4\Runtime\ResourceManager\Util\MonoBehaviourCallbackHooks.cs:19)
    Everything works when I'm using 1.1.10. Any ideas for what might've changed?
     
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    It looks like you are using an AssetReference (hence the key it can't find looking like a guid). We made some changes to that system in 1.2.x to support sub object references. I'm guessing it's related to that, but would need some details.
    What exact type is the reference?
    What type of object is in there?
    Have you tried calling Addressables.InitializeAsync first, then doing this asset reference load after the init is done?

    If possible, making a bug against unity would be the simplest way for us to repro this and figure it out.
     
  3. Glaswyll

    Glaswyll

    Joined:
    Feb 13, 2014
    Posts:
    103
    The reference is an AssetReference.
    The object is an AudioMixer.

    I'll look up the docs for InitializeAsync and give it a try. Right now I'm passing in the AssetReference to a method that has this code:
    Code (CSharp):
    1. Addressables.DownloadDependenciesAsync(assetReference).Completed += onDependencyLoaded;
    2. Addressables.LoadAssetAsync<AudioMixer>(assetReference).Completed += onAssetLoaded;
    Thanks for the reply.
     
  4. Glaswyll

    Glaswyll

    Joined:
    Feb 13, 2014
    Posts:
    103
    It's still happening, but looking at the inspector field for it, I see something that I didn't notice previously, and wasn't there in 1.1.10. It's likely related to what you mentioned about supporting sub object references. Previously I was loading the entire Mixer and looping through all the groups to cache the group references. Now it appears I need to specify mixer groups? This seems like a better approach, but I'll have to refactor some stuff to get it working if that's the case.

    In 1.1.10, this didn't have a secondary dropdown:
    audio-mixer-reference-01.jpg

    I'm guessing that's where it's failing.
     
  5. Glaswyll

    Glaswyll

    Joined:
    Feb 13, 2014
    Posts:
    103
    Ok, it's still happening and I've hit a blocker. Attached is a simple repro project that can reproduce the failure.
     

    Attached Files:

  6. Glaswyll

    Glaswyll

    Joined:
    Feb 13, 2014
    Posts:
    103
    @unity_bill Have there been any updates? This is currently a blocker for us. I was able to get around it for now, but the Mixer Groups aren't loading from Addressables.
     
  7. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    Ah, we must have done something weird with the auido mixer type. Thanks for the repro project. I've created a ticket in our system to look at this. It's high priority, but with our cadence that still likely means at least a couple weeks to have a fix out.
     
  8. Glaswyll

    Glaswyll

    Joined:
    Feb 13, 2014
    Posts:
    103
    That works, thank you for the update. I'm bypassing the audio mixer loading, so I'll just focus on other areas for the time being.
     
  9. Glaswyll

    Glaswyll

    Joined:
    Feb 13, 2014
    Posts:
    103
    @unity_bill Just wanted to check in for an update regarding this defect. Any news? Thanks!
     
  10. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    762
    Hey @Glaswyll we actually have a fix for this in our 1.3 version when it releases. There was an issue where we weren't converting the editor type for AudioMixerGroups to their appropriate runtime type. When that releases here before too long let us know if you're still having trouble. I believe I actually tested this fix with the project you provided.
     
    Glaswyll likes this.
  11. Glaswyll

    Glaswyll

    Joined:
    Feb 13, 2014
    Posts:
    103
    @DavidUnity3d That's great news, thank you for the update! I will definitely report back after it releases.
     
    davidla_unity likes this.
  12. Glaswyll

    Glaswyll

    Joined:
    Feb 13, 2014
    Posts:
    103
    Hey @DavidUnity3d I wanted to report back confirmation that Addressables v1.3.3 resolved the issue I was seeing. Thank you so much for getting this fixed!
     
    davidla_unity likes this.