Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

addressables_content_state not being generated in Addressables 0.5.3, Packed Play Mode not working

Discussion in 'Addressables' started by RecursiveFrog, Dec 28, 2018.

  1. RecursiveFrog

    RecursiveFrog

    Joined:
    Mar 7, 2011
    Posts:
    83
    I recently updated to 0.5.3 from 0.4.8 (skipping 0.5.2), alongside migrating to Unity 2018.3.0f2 from the latest version of 2018.2.

    Previously, if I were to build my game for Windows I would generate a addressables_content_state.bin file, which I would then target for content updates. However, this file is no longer generated when building my game. It does appear that I can "Build Player Content" and end up with oodles of asset bundles in my StreamingAssets folder (as I expect), but each time I want to change or update assets I end up having to delete the entire built directory structure or else the player content won't update at all.

    Worse, with no apparent rhyme or reason, some of my assets simply fail to load using the Addressables loading API in Packed Play Mode, both in a published app and in the editor. This seems to be a regression, as I was able to make use of the addressable asset bundles before in both the editor and in a published Game. This happens both with scenes and prefabs, but not with every scene or every prefab.

    Code (CSharp):
    1.  
    2. Addressables - Unable to load runtime data at location C:/redacted/StreamingAssets/com.unity.addressables/settings.json.
    3.  
    4. (Filename: C:/redacted/Library/PackageCache/com.unity.addressables@0.5.3-preview/Runtime/Addressables.cs Line: 159)
    5. InvalidKeyException encounterd in operation UnityEngine.ResourceManagement.CompletedOperation`1[UnityEngine.SceneManagement.Scene], result='UnityEngine.SceneManagement.Scene', status='None', valid=True, location=..
    6.  
    7.  
     
  2. itthereforeim

    itthereforeim

    Joined:
    Apr 28, 2014
    Posts:
    18
    For .bin file problem:

    This is not a bug, read change log and you can get understand the reason why :)

    In short:
    1. .bin file path changed, in Assets\AddressableAssetsData
    2. auto build content has been disabled in 053 update, you have to update manually

    btw, .bin file generate without static content settings now~ finally ~
     
    MNNoxMortem likes this.
  3. RecursiveFrog

    RecursiveFrog

    Joined:
    Mar 7, 2011
    Posts:
    83
    Thanks for the info, I did find the .bin file thanks to that. So, I'm still having some weird issues. No problems occur when I try to use Fast Play mode, and I wouldn't expect there to be. However, some (not all) assets aren't accessible in Packed Play Mode. The IAsyncOperation's .Result is simply null when I try to load them using Addressbles.LoadAssets<GameObject>()

    Code (CSharp):
    1. // This works in Fast Mode...
    2. // but fails in Packed Play Mode
    3. // Note : The address is the same as the actual file path.  I didn't bother changing it from the default.
    4.  
    5. yield return Addressables.LoadAssets<GameObject>("Assets/Resources/Characters/Recruitable/Person.prefab", DidLoadRecruitable);
    6.  
    7. //..........
    8.  
    9. private void DidLoadRecruitable(IAsyncOperation<GameObject> op)
    10. {
    11.     string r = op.Result != null ? op.Result.ToString() : "was null!";
    12.     Debug.Log(message: $"DidLoadRecruitable result : {r}");
    13.             // Do stuff with op.Result here...
    14. }
    Please note that the scene from which this happens is itself an Addressable asset, and I was able to load that scene.
     
  4. RecursiveFrog

    RecursiveFrog

    Joined:
    Mar 7, 2011
    Posts:
    83
    I seem to have solved my issue. In the 0.5.3 release of Addressables, I cannot give an addressable asset to objects in the Resources folder and have that actually load at runtime in Packed Play Mode, either in the editor or in a built game.

    Moving those assets out of the resources folder resolved the issue.

    But isn't part of the goal of Addressables to be able to use them to load assets that live anywhere, including Resources?
     
    MNNoxMortem likes this.
  5. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    294
    yes, that is the intent. It sounds like we may have a play-mode-specific issue. Or something to do with loading Resources at all. Either way we'll look into it.

    Thanks
     
    MNNoxMortem likes this.