Search Unity

Addressables package does not load in 2019.1.0b3

Discussion in 'Addressables' started by mlaibow, Feb 14, 2019.

  1. mlaibow

    mlaibow

    Joined:
    Feb 5, 2014
    Posts:
    40
    I am using the Addressables 0.5.3-preview package nicely in 2018.3.5f1.

    I have all of the assets organized in groups and I can async load them in the code, and it all compiles as it should, with the bundles properly packed. I can also run it in Packed Play Mode in the editor.

    I am trying to use 2019.1.0b3 because of a few features that I am interested in and because it will most likely come out of beta just before we release the game.

    Everything seems to import and update fine when I open the (copy of) the project in 2019.1.0b3 until it gets to the addressables package, at which point I get these errors:

    Library\PackageCache\com.unity.addressables@0.5.3-preview\Editor\Build\DataBuilders\NodeGraph\BuildGraphGUI.cs(269,21): error CS0103: The name 'outputContainer' does not exist in the current context

    Library\PackageCache\com.unity.addressables@0.5.3-preview\Editor\Build\DataBuilders\NodeGraph\BuildGraphGUI.cs(265,98): error CS0103: The name 'Port' does not exist in the current context

    Library\PackageCache\com.unity.addressables@0.5.3-preview\Editor\Build\DataBuilders\NodeGraph\BuildGraphGUI.cs(265,80): error CS0103: The name 'Direction' does not exist in the current context

    And so on, 84 of them. They are mostly something could not be found in the BuildGraphGUI.cs file.

    I understand that this is a beta unity version and a preview package of addressables, but this does seem like a regression of some sort. If there is something I can do to get addressables package to load in 2019.1 that would be great, it just seems like it loads the package into the packagecache without some dependency for the editor windows. If not, then back to 2018, since I cannot repackage all of the assets.

    Thanks,
    -mat
     
  2. TommyTheITGuy

    TommyTheITGuy

    Joined:
    Jun 11, 2015
    Posts:
    53
    Seems like errors related to their UI API. Unity is slowly transitioning to using UIElements for all their UI and maybe 2019 version removed some old APIs that Adressables were using.

    Switch back to 2018, open your IDE and navigate to that code and check in which namespaces/assemblies those missing symbols were. Then check if 2019 has those. They could also be from another package, that updated and you have a diffrent version in 2019 than you had in your 2018 installation.

    And may I suggest, developing a game using 2019 right now is very risky, you'd be better of using 2018.3, which will transition to an LTS release, proably in late March.
     
    MNNoxMortem likes this.
  3. johnseghersmsft

    johnseghersmsft

    Joined:
    May 18, 2015
    Posts:
    28
    Search failed me when looking for threads dealing with 2019.1b. I posted yesterday about this as well.

    The problem is that 2019.1b moved much of UIElements from the Experimental namespace and also some of the VisualElement properties changed names and/or access permissions. I'm attempting to work around this by modifying the code from the package.

    I've gotten rid of the compiler errors (but I'm importing code from another project and detangling some other dependencies of my own, so I don't yet have a clean project using the modified Addressables code.

    A few pointers if you try it yourself: Remove "Experimental" from most of the UIElements namespaces. GridView, however, is still experimental, but the namespace has changed.

    EditorWindow.GetVisualRouteContainer is now EditorWindow.rootVisualElement
    DropdownMenu.MenuAction.StatusFlags is now DropdownMenuAction.Status
    VisualElement.persistenceKey is now viewDataKey
    Focusable.focusIndex is now tabIndex
    VisualElement.layout is no longer assignable (changed to internal access), so need to use .Set(x, y, w, h)
     
  4. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    For someone who cannot check the Package Manager because the usual compile deadlock, you can edit manifest :

      "registry": "https://staging-packages.unity.com",


    and

        "com.unity.addressables": "1.0.2-preview.2",


    It contains the code which already fixed the UIElements problem. However it was strongly discoraged to use staging registry for AAS (while it is required for some other packages to make things work) because ppl would spam report bugs from that registry that they know are broken and just annoy the dev. However if you want to get the project to compile at all cost right now, you may take this risk. (and do not report problems from that version)

    Few things that need changing on 0.5.3 -> 1.0.2 transition :

    - ChainOperation and other's delegate signature is now IAsyncOperation and not the result, use .Result to get the result.
    - To use IAsyncOperation in your game you now use using `UnityEngine.ResourceManagement.AsyncOperations` namespace.
    - Remove <GameObject> generic from Instantiate API because that's the only choice to make it work.
    - If you used editorAsset setter, change it to `.SetEditorAsset(Object value)`. I guess that setter was doing too much it is made into a method now.
     
    Last edited: Feb 23, 2019
    johnseghersmsft likes this.
  5. mlaibow

    mlaibow

    Joined:
    Feb 5, 2014
    Posts:
    40
    i will definitely give this a try. one of the first things i did when trying to get 2019.1 beta to work with the addressables package was to point the package manager to the staging repo. unfortunately, when pointed to the staging repo, opening the package manager ui in 2019.1 beta freezes unity.

    i believe this is a known issue, that the package manager ui crashes unity in 2019.1 beta when pointed to the staging repository. i have seen a forum post on this, which had a reply from a unity dev. i had expected it to be resolved in the latest beta (4) since that forum post was long before it. but it is is still an issue in 2019.1.0b4.

    that said, i can edit the manifest directly to update addressables to 1.0.2, just as long as i don't open the package manager ui in unity.
    i will give this a try, thanks for the migration notes.
     
  6. johnseghersmsft

    johnseghersmsft

    Joined:
    May 18, 2015
    Posts:
    28
    PackageManager still freezes in beta 4.
    Workaround for adding other packages via package manager after you've added staging to use the newer version of addressables:
    1) Close Unity and make a copy of manifest.json (just in case)
    2) Remove the staging repository from manifest.json
    3) Open project in Unity...you will have errors reported, but the PackageManager now works
    4) Add other packages you want to use
    5) Close Unity
    6) compare manifest.json with the copy--it should only have added the new packages. If it changed any others, you probably want to maintain the latest version reference.
    7) Add staging back in.