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

How to upgrade from 0.5.3 to 0.6.6

Discussion in 'Addressables' started by iamarugin, Mar 6, 2019.

  1. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    880
    I updated Addressables to 0.6.6, cleaned build cache, rebuild assets and got tons of errors in console like:

    Code (CSharp):
    1. NullReferenceException encountered in operation UnityEngine.AddressableAssets.Initialization.InitializationOperation, result='UnityEngine.AddressableAssets.ResourceLocators.ResourceLocationMap', status='Failed', valid=True, location=RuntimeData..
    2. UnityEngine.ResourceManagement.Util.DelayedActionManager:LateUpdate()
    3.  
    4. IAsyncOperation Validation Failed!
    5. UnityEngine.ResourceManagement.Util.DelayedActionManager:LateUpdate()
    6.  
    7. NullReferenceException: Object reference not set to an instance of an object
    8. UnityEngine.ResourceManagement.ResourceProviders.CachedProvider+CacheEntry`1[TObject].set_Key (System.Object value) (at Library/PackageCache/com.unity.addressables@0.6.6-preview/Runtime/ResourceManager/ResourceProviders/CachedProvider.cs:143)
    9. UnityEngine.ResourceManagement.AsyncOperations.GroupOperation`1[TObject].set_Key (System.Object value) (at Library/PackageCache/com.unity.addressables@0.6.6-preview/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:511)
    10. UnityEngine.ResourceManagement.AsyncOperations.ChainOperation`2[TObject,TObjectDependency].set_Key (System.Object value) (at Library/PackageCache/com.unity.addressables@0.6.6-preview/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:456)
    11. UnityEngine.ResourceManagement.AsyncOperations.GroupOperation`1[TObject].set_Key (System.Object value) (at Library/PackageCache/com.unity.addressables@0.6.6-preview/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:511)
    12. UnityEngine.AddressableAssets.Addressables.LoadAssets[TObject] (System.Collections.Generic.IList`1[T] locations, System.Action`1[T] callback) (at Library/PackageCache/com.unity.addressables@0.6.6-preview/Runtime/Addressables.cs:584)
    13. UnityEngine.AddressableAssets.Addressables.LoadAssets[TObject] (System.Object key, System.Action`1[T] callback) (at Library/PackageCache/com.unity.addressables@0.6.6-preview/Runtime/Addressables.cs:633)
    14. UnityEngine.AddressableAssets.Addressables+<>c__DisplayClass54_0`1[TObject].<LoadAssets>b__0 (UnityEngine.ResourceManagement.AsyncOperations.IAsyncOperation`1[T] op) (at Library/PackageCache/com.unity.addressables@0.6.6-preview/Runtime/Addressables.cs:625)
    15. UnityEngine.ResourceManagement.AsyncOperations.ChainOperation`2[TObject,TObjectDependency].OnDependencyCompleted (UnityEngine.ResourceManagement.AsyncOperations.IAsyncOperation`1[T] op) (at Library/PackageCache/com.unity.addressables@0.6.6-preview/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:429)
    16. UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].InvokeCompletionEvent () (at Library/PackageCache/com.unity.addressables@0.6.6-preview/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:316)
    17. UnityEngine.ResourceManagement.Util.DelayedActionManager:LateUpdate()
    18.  
    19. Exception: Invalid path in AssetBundleProvider: 'C:/Unity/rocket_science/Assets/StreamingAssets/aa/StandaloneWindows64/schemas_assets_all_171d2df001cd89b6249ea46ada365a57.bundle'.
    20. UnityEngine.ResourceManagement.Util.DelayedActionManager:LateUpdate()
    21.  
    22. Exception encountered in operation UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider+InternalOp`1[System.Object], result='', status='None', valid=True, location=C:/Unity/rocket_science/Assets/StreamingAssets/aa/StandaloneWindows64/schemas_assets_all_171d2df001cd89b6249ea46ada365a57.bundle..
    23. UnityEngine.ResourceManagement.Util.DelayedActionManager:LateUpdate()
    24.  
    Any directions?

    Also I see the new directory "aa" created in StreamingAssets folder. What is this? Why it has such strange name?
     
  2. Chocolate-Pi

    Chocolate-Pi

    Joined:
    Oct 17, 2015
    Posts:
    8
    I'm having the same issue. Copying the built Asset Bundles target platform folder (StandaloneWindows64) from the location they are built (/com.unity.addressables) to /aa fixes the errors being thrown, but in my case the assets (Atlas'd Sprites) do not fully load. I am unsure if this second behavior is related to the this Loading issue, or an entirely different problem related to Sprite Atlases.

    Edit: I can confirm that the Sprites not loading is simply the pre-existing Atlas issue, where only the last page of each Atlas is built into the bundle. It is unrelated to this path issue.
     
    Last edited: Mar 7, 2019
    nik_d and Walid-Alouani like this.
  3. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    880
    Purging all addressables settings and recreating them from scratch helped with errors above. But there are some other problems appeared after building the game. Like materials loaded from addressables don't pickup refernced textures in them, or if loaded prefab has references to another prefab this another prefab is empty, etc. I am totaly don't understand something or this release is a bit broken.
     
    MNNoxMortem likes this.
  4. RecursiveFrog

    RecursiveFrog

    Joined:
    Mar 7, 2011
    Posts:
    350
    I think a similar thing happened to me, where nested prefabs lost references to things like Avatars for their Animators. I didn't try to make each sub-prefab addressable. Instead I made the Avatar addressable, and that did work... but maybe making each sub-prefab addressable would have solved the issue too.
     
  5. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    the "aa" thing is related to the "breaking change" noted in the changelog:

    Code (CSharp):
    1. any hardcoded profile path to com.unity.addressables (specifically LocalLoadPath, RemoteLoadPath, etc) should use UnityEngine.AddressableAssets.Addressables.RuntimePath instead.
    2. For build paths, replace Assets/StreamingAssets/com.unity.addressables/[BuildTarget] with [UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget] For load paths, replace Assets/StreamingAssets/com.unity.addressables/[BuildTarget] with {UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]
    3.  
    From looking at this thread however, it seems that there may be an additional issue around sub-prefabs. If you can create a repro case, please file a bug against Unity, and put the case number in this thread.
     
    MNNoxMortem likes this.
  6. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Just wondering, is this issue now known or resolved? I am on 0.6.8, and is facing the same issue as OP.

    Screen Shot 2019-04-17 at 16.19.25.png Screen Shot 2019-04-17 at 16.19.34.png Screen Shot 2019-04-17 at 16.19.39.png Screen Shot 2019-04-17 at 16.19.44.png Screen Shot 2019-04-17 at 16.19.54.png

    Some observations:

    - Errors only appear with Packed Mode .
    - The assets did load properly, I think.
    - All these assets are ScriptableObject assets.
    - However errors are thrown that cause my async code to exit incorrectly.
    - I am using IAsyncOperation with await with code similar to this.
     
  7. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    OK, so the workaround here really is to nuke the Addressable config and recreate everything.

    I just did and with the same setup, no code touched, the async load no longer throw Exceptions.

    Screen Shot 2019-04-17 at 16.49.31.png