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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

UI Builder preview 12 errors in 2020.3.0f1

Discussion in 'UI Toolkit' started by JohannesMP, Mar 14, 2021.

  1. JohannesMP

    JohannesMP

    Joined:
    Nov 4, 2016
    Posts:
    21
    I am attempting to install the latest version of UI Builder (which is listed as 1.0.0-preview.12 on https://docs.unity3d.com/2020.3/Documentation/Manual/com.unity.ui.builder.html as of this writing) using the Package Manager in Unity 2020.3.0f1

    When I install 1.0.0-preview.12 in a clean project I get the following errors:
    Code (CSharp):
    1. Library\PackageCache\com.unity.ui.builder@1.0.0-preview.12\Editor\Utilities\StyleField\FieldSearchCompleter.cs(482,38): error CS1061: 'ScrollView' does not contain a definition for 'horizontalScrollerVisibility' and no accessible extension method 'horizontalScrollerVisibility' accepting a first argument of type 'ScrollView' could be found (are you missing a using directive or an assembly reference?)
    2.  
    3. Library\PackageCache\com.unity.ui.builder@1.0.0-preview.12\Editor\Utilities\StyleField\FieldSearchCompleter.cs(482,69): error CS0103: The name 'ScrollerVisibility' does not exist in the current context
    4.  
    5. Library\PackageCache\com.unity.ui.builder@1.0.0-preview.12\Editor\Builder\Inspector\BuilderInspectorAttributes.cs(242,39): error CS1061: 'ScrollView' does not contain a definition for 'horizontalScrollerVisibility' and no accessible extension method 'horizontalScrollerVisibility' accepting a first argument of type 'ScrollView' could be found (are you missing a using directive or an assembly reference?)
    6.  
    7. Library\PackageCache\com.unity.ui.builder@1.0.0-preview.12\Editor\Builder\Inspector\BuilderInspectorAttributes.cs(242,71): error CS0103: The name 'ScrollerVisibility' does not exist in the current context
    8.  
    9. Library\PackageCache\com.unity.ui.builder@1.0.0-preview.12\Editor\Builder\Inspector\BuilderInspectorAttributes.cs(250,39): error CS1061: 'ScrollView' does not contain a definition for 'verticalScrollerVisibility' and no accessible extension method 'verticalScrollerVisibility' accepting a first argument of type 'ScrollView' could be found (are you missing a using directive or an assembly reference?)
    10.  
    11. Library\PackageCache\com.unity.ui.builder@1.0.0-preview.12\Editor\Builder\Inspector\BuilderInspectorAttributes.cs(250,69): error CS0103: The name 'ScrollerVisibility' does not exist in the current context
    This does not occur with Version 1.0.0-preview.11
     
  2. Slandercakes

    Slandercakes

    Joined:
    Jul 30, 2015
    Posts:
    15
    I'm experiencing the same issue. Should we be using a different package/version with 2020.3?
     
  3. Mortuus17

    Mortuus17

    Joined:
    Jan 6, 2020
    Posts:
    105
    If you doubleclick on the errors, you can see that it has to do with preprocessor directives which account for version 2020.1 and 2020.2 but not 2020.3 and it falls back to code for Unity versions 2019 and below, causing errors.

    Unfortunately, changing the code manually does nothing as the changes get reverted automatically.
     
  4. Slandercakes

    Slandercakes

    Joined:
    Jul 30, 2015
    Posts:
    15
    It seems that removing and reinstalling the UI builder package fixed the errors for me.
     
  5. Mortuus17

    Mortuus17

    Joined:
    Jan 6, 2020
    Posts:
    105
    ... until you restart the editor ;)
     
  6. Slandercakes

    Slandercakes

    Joined:
    Jul 30, 2015
    Posts:
    15
    Whoops! It seems they're aware of the bug (I saw another thread mentioning it) so hopefully they'll push a fix soon.
     
    Mortuus17 likes this.
  7. Agentmass

    Agentmass

    Joined:
    Jun 19, 2020
    Posts:
    3
    Hmm... downgrading to preview 11 and then upgrading again resolves the issue for me, even after restarting.
     
  8. Mortuus17

    Mortuus17

    Joined:
    Jan 6, 2020
    Posts:
    105
    Not for me. The same exact errors are still there.
     
  9. martinpa_unity

    martinpa_unity

    Unity Technologies

    Joined:
    Oct 18, 2017
    Posts:
    364
    Hey! We are aware of the issue and we will need to release another version of the UI Builder package. Since 2020.3 is the LTS version, the workaround for now is to stay on the latest 2020.2 version (which should be pretty much the same) until the new package version is out.
     
    Midiphony-panda likes this.
  10. VOTRUBEC

    VOTRUBEC

    Joined:
    Dec 17, 2014
    Posts:
    97
    Might this also be the issue that's stopping me from searching for VisualElements within a TemplateContainer? Previously, after I had cloned the asset tree, all Visual Elements were queryable as if they had been included in the single UXML document, instead of an included Template. I'm just deciding whether I should be spending time on a workaround, or if the new package you mention should resolve this.
     
  11. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    666
    Hello! A new version of the UI Builder is out and should fix these issues reported here.
     
    Mortuus17 likes this.
  12. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    366
    I can confirm this errors are gone now. But another one still remains (was mentionioned in another thread, I think but I could't find it):

    error CS1503: Argument 1: cannot convert from 'UnityEngine.Sprite' to 'UnityEngine.UIElements.Background'

    When opening Unity.
    it dissapears when the code is compiled once.
     
  13. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    735
    Does this happen in the UI Builder code or your own code?
     
  14. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    366
    it is in our own code, but there is no error.


    Code (CSharp):
    1.  
    2. public void SetPicture(Sprite image)
    3. {
    4.        pictureElement.style.backgroundImage = new StyleBackground(image);
    5. }
    This line throws the error.
    But When I open the script in Visual Studio. it shows no error there, since there is a constructor for StyleBackground with a Sprite as parameter.
    When the code is compiled once, the error is gone in Unity
     
  15. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    735
    Looks very similar to the issue described at the beginning of this thread:
    https://forum.unity.com/threads/com...g-version-of-ui-toolkit-used-by-unity.1073120
     
  16. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    366
    Yes it is. I just didn't find the thread