Search Unity

Bug Upgrading to 2021.2.0a11 breaks projects using Entities 0.17.0

Discussion in 'Entity Component System' started by DK_A5B, Apr 1, 2021.

  1. DK_A5B

    DK_A5B

    Joined:
    Jan 21, 2016
    Posts:
    110
    After upgrading to 2021.2.0a11 (from 2021.2.0a10), my project will no longer load. I receive the following error message:

    Library\PackageCache\com.unity.platforms@0.10.0-preview.10\Editor\Unity.InternalAPIEditorBridge.012\EditorGUIBridge.cs(15,45): error CS0426: The type name 'HyperLinkClickedEventArgs' does not exist in the type 'EditorGUILayout'

    It appears that the source of the problem is that the latest version of the Entities package has a dependency on the com.unity.platforms package, which is broken by the upgrade to 2021.2.0a11.

    Tracing the dependency in the packages-lock.json file, it looks like the Entities package (com.unity.entities) is the source of the dependency on com.unity.platforms 0.10.0-preview.10. My project uses the latest version of the Entities package (0.17.0-preview.41).

    To rule out that it was an issue with the upgrade process, I also create a new project with 2021.2.0a11. This worked fine. Then I added the latest version of the Entities package (0.17.0) and then I get the same error message in the com.unity.platforms package.

    Cross posted to the 2021.2 Alpha forum: https://forum.unity.com/threads/upg...s-entities-0-17-0-preview-41-package.1085771/
     
  2. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    I copied "com.unity.platforms@0.10.0-preview.10" to the packages folder to make it embedded, then changed the EditorGuiBridge.cs file to this:

    Code (CSharp):
    1. using System;
    2. using System.Collections.Generic;
    3. using UnityEditor;
    4.  
    5. namespace Unity.Build.Bridge
    6. {
    7.     internal static class EditorGUIBridge
    8.     {
    9.         [InitializeOnLoadMethod]
    10.         static void Register()
    11.         {
    12.             EditorGUI.hyperLinkClicked += (sender, args) =>
    13.             {
    14.                 var hyperLinkArgs = new Dictionary<string, string>();
    15.                 if (args is HyperLinkClickedEventArgs editorArgs)
    16.                 {
    17.                     foreach (var pair in editorArgs.hyperLinkData)
    18.                     {
    19.                         hyperLinkArgs.Add(pair.Key, pair.Value);
    20.                     }
    21.                 }
    22.                 HyperLinkClicked?.Invoke(hyperLinkArgs);
    23.             };
    24.         }
    25.  
    26.         public static event Action<IReadOnlyDictionary<string, string>> HyperLinkClicked;
    27.     }
    28. }
    29.  
    Lines 15 and 17 have been edited.
     
  3. goodnewsjimdotcom

    goodnewsjimdotcom

    Joined:
    May 24, 2017
    Posts:
    342
    Uh, I am just gonna wait til Unity fixes it properly. I got this bug in .11 and .12 So I stay on .10
     
    futurlab_peterh likes this.
  4. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    Despite my above post, I reverted back to LTS because I couldn't remember what f****** scripts were meant to be where my 'missing script' errors were... I can't believe this is still a problem today... can you just tell us the last known script name...

    PSA: If you are using UI toolkit and upgrading from a UI Toolkit package version, screenshot all your UI Toolkit scripts in the hierarchy so you know what to fix...
     
    Last edited: Apr 7, 2021
    thelebaron likes this.
  5. DK_A5B

    DK_A5B

    Joined:
    Jan 21, 2016
    Posts:
    110
    I just tried upgrading to 2021.2.0a12 and I'm still seeing this issue.
     
  6. RecursiveEclipse

    RecursiveEclipse

    Joined:
    Sep 6, 2018
    Posts:
    298
    The lesson I've learned is just don't bother trying to use alpha releases. There is usually something that breaks my project, or at least an annoying/confusing UX change. Sometimes everything works(or mostly works), but it's not worth the time downloading, upgrading, and debugging when it doesn't.

    Unless there is something you need in the alpha, or you're really committed to helping Unity solve this issue, stick to official releases/lts. I use all the latest DOTS packages on 2020.3.2f1
     
    Last edited: Apr 7, 2021
  7. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    I'm mostly just attracted to the syntactic sugar in the c# 9 release. But that can wait a bit longer haha.
     
  8. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    857
    The reduced build times with the alpha are really nice, considering how important for dots(in my case anyway) it is to make sure things are working in editor and a build, since things can go wonky pretty easily. The UITK issues are frustrating & hard to narrow down, but I guess that's my fault for using all preview stuff on top of an alpha
     
  9. DK_A5B

    DK_A5B

    Joined:
    Jan 21, 2016
    Posts:
    110
    To be clear, I'm not complaining that there are bugs in the alpha build. It's an alpha, bugs (even serious ones) are going to happen. I've got my reasons why I feel it makes sense to be working with the alpha builds for my project.

    I posted because this particular issue breaks the Editor when using DOTS, which I know is a core focus for the future of Unity, and so I wanted to raise awareness to both the Unity team and any other developers trying to work with DOTS and the 2021.2 alpha build path.
     
  10. DK_A5B

    DK_A5B

    Joined:
    Jan 21, 2016
    Posts:
    110
    Well, now I am complaining.

    Apparently the root cause of this is that DOTS (or at least the part of the stack that depends on the Entities package, which is most of DOTS) is not, and will not be, supported on Unity 2021. Per an announcement made yesterday, anything dependent on the Entities package will only be supported on Unity 2020 LTS. This will remain the case until some undefined time in the future, but definitely not before 2022.

    So, for anyone who wants to work with the ECS part of DOTS (which is a core part of DOTS), you'll need to stay on the 2020 LTS path until further notice. If you're like me and you're already running on the 2021 path, you'll need to downgrade your project(s) to 2020 LTS in order to work with ECS.
     
    futurlab_peterh and Anthiese like this.