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 1.12 gives error "Address cannot contain [ ]" but address doesn't contain such thing

Discussion in 'Addressables' started by CanisLupus, Jul 23, 2020.

  1. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    Another thread. We are using this code:
    Code (CSharp):
    1. var operation = Addressables.LoadContentCatalogAsync(url);
    Where url is this:
    And, on the exact line of the call, we get this error :
    What? :eek: This has got nothing to do with the address used, but is actually the Resources path of the instantiated prefab that contains the script where the above code is called. Why is this happening? Was fine before 1.12.
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,795
    Thanks for flagging! Could you also (if you haven't already) submit a bug report for us?
     
  3. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    Sadly I haven't due to lack of time. :( We also had trouble with another prefab with [ ] in the name that WASN'T the object containing the script of the above code, so this might just be related to calling Resources.Load on an asset with a weird name while Addressables are doing something. (wild guess!)

    I can try to create a report next week, but I'm not sure if I'll be able to. If I do I'll let you know here.
     
  4. aeonphyxius

    aeonphyxius

    Joined:
    Jun 16, 2013
    Posts:
    13
    As a heads up, we are having the same problem getting that error.

    In our case it happens when building the addressables. We rolledback to 1.10.0 and now we can build them again. In our case the asset in question it does contain [] . But do not understand this change and the need of it.
     
  5. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    Intersting that it is happening for you while building!

    We have found that the error persists even if we disable the creation of the prefab after it happened once. With default Addressable settings (no groups), this code is enough to trigger the problem:
    Code (CSharp):
    1. Resources.Load<GameObject>("[Test]");    // just call this beforehand
    2. Addressables.LoadContentCatalogAsync("url");    // "url" is invalid and will throw errors, but it also happens with valid urls
    I have submitted a bug report, case 1266093.
     
  6. PixelLifetime

    PixelLifetime

    Joined:
    Mar 30, 2017
    Posts:
    90
    Hi, is it possible to support `[]`? Most of my assets in projects have them.

    I believe if it's allowed to name something like that in the editor - it should not constrain us in such a way with Addressables. What I mean is it's very convenient for us to name assets in a manner of `[Scene] Test` or `[Material] Cog`, also some of the code and regex could be used to conveniently do things with names like that, but Addressables don't allow this :(
     
  7. ProtoTerminator

    ProtoTerminator

    Joined:
    Nov 19, 2013
    Posts:
    566
    @PixelLifetime It should be allowed to have [] in the asset names, it's just not allowed in the address since it's reserved for sub-objects. This seems to just be a bug.
     
  8. PixelLifetime

    PixelLifetime

    Joined:
    Mar 30, 2017
    Posts:
    90
    Still if it doesn't recognise it being a special command in address why not allow it? I like to keep my paths full, they might contain multiple `[]` in the address, it's tedious work to rename address each time. What I mean - with `[]` restriction = manual labor is required, without naming objects containing `[]` = no manual labor required, the obvious choice is not to use `[]` in object names at all which is restricting and unintuitive.
     
  9. ProtoTerminator

    ProtoTerminator

    Joined:
    Nov 19, 2013
    Posts:
    566
    The restriction is only there for purposes of addressing sub-objects. How would you change it?
     
  10. PixelLifetime

    PixelLifetime

    Joined:
    Mar 30, 2017
    Posts:
    90
    `Assets/Sheet/sprite_sheet_0`, `Assets/Sheet/sprite_sheet_1`, `Assets/Sheet/sprite_sheet_3`...
    Or path could have an escape sequence like `Assets/\[Scene\] Test`.
     
  11. dogboydog

    dogboydog

    Joined:
    Nov 23, 2012
    Posts:
    53
    Wouldn't that be the asset name? Not the address which looks more like "30d8dfb7bcb23db40afb8b7d629644dc"
     
  12. PixelLifetime

    PixelLifetime

    Joined:
    Mar 30, 2017
    Posts:
    90
    When I try to change `Addressable Name` from `Assets/Angry Cubero.prefab` to `Assets/[Angry Cubero].prefab` - this error pops up.
    upload_2020-8-3_1-9-36.png