Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question The type or namespace name 'Collections' does not exist in the namespace 'UnityEngine.UI'

Discussion in 'Scripting' started by sera0506, Nov 15, 2021.

Thread Status:
Not open for further replies.
  1. sera0506

    sera0506

    Joined:
    Apr 1, 2014
    Posts:
    7
    Hi,
    I trying upgrade my project from Unity 2019.4.7 to Unity 2019.4.32.
    when Project in Version 2019.4.32,
    I got compile error like this
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\CanvasUpdateRegistry.cs(3,22): error CS0234: The type or namespace name 'Collections' does not exist in the namespace 'UnityEngine.UI' (are you missing an assembly reference?)

    I tried re-downloading Unity UI from Package manager or tried to restart unity,
    the error still exists

    Does anyone know what happened?
    How can I fix this error. Q^Q
     
  2. sera0506

    sera0506

    Joined:
    Apr 1, 2014
    Posts:
    7
    Editor.log
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\CanvasUpdateRegistry.cs(3,22): error CS0234: The type or namespace name 'Collections' does not exist in the namespace 'UnityEngine.UI' (are you missing an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\GraphicRebuildTracker.cs(3,22): error CS0234: The type or namespace name 'Collections' does not exist in the namespace 'UnityEngine.UI' (are you missing an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\GraphicRegistry.cs(2,22): error CS0234: The type or namespace name 'Collections' does not exist in the namespace 'UnityEngine.UI' (are you missing an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\CanvasUpdateRegistry.cs(86,26): error CS0246: The type or namespace name 'IndexedSet<>' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\CanvasUpdateRegistry.cs(87,26): error CS0246: The type or namespace name 'IndexedSet<>' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(17,75): error CS0246: The type or namespace name 'ILayoutElement' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\MaskableGraphic.cs(10,54): error CS0246: The type or namespace name 'IClippable' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\MaskableGraphic.cs(10,77): error CS0246: The type or namespace name 'IMaterialModifier' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\GraphicRebuildTracker.cs(13,16): error CS0246: The type or namespace name 'IndexedSet<>' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\GraphicRegistry.cs(13,45): error CS0246: The type or namespace name 'IndexedSet<>' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Graphic.cs(702,47): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(841,48): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(937,35): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\EventSystem\ExecuteEvents.cs(236,33): error CS0246: The type or namespace name 'ObjectPool<>' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(953,37): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(996,43): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(1074,34): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Mask.cs(19,60): error CS0246: The type or namespace name 'IMaterialModifier' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(1318,29): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(1329,29): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(1380,35): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\InputField.cs(26,9): error CS0246: The type or namespace name 'ILayoutElement' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\RectMask2D.cs(23,44): error CS0246: The type or namespace name 'IClipper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\MaskUtilities.cs(140,58): error CS0246: The type or namespace name 'IClippable' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\RawImage.cs(132,48): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\ScrollRect.cs(18,159): error CS0246: The type or namespace name 'ILayoutElement' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\ScrollRect.cs(18,175): error CS0246: The type or namespace name 'ILayoutGroup' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\RectMask2D.cs(301,34): error CS0246: The type or namespace name 'IClippable' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\RectMask2D.cs(320,37): error CS0246: The type or namespace name 'IClippable' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\RectMask2D.cs(26,26): error CS0246: The type or namespace name 'RectangularVertexClipper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\RectMask2D.cs(35,25): error CS0246: The type or namespace name 'IClippable' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Text.cs(10,42): error CS0246: The type or namespace name 'ILayoutElement' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Graphic.cs(173,49): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Text.cs(641,48): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\InputField.cs(2618,36): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\InputField.cs(2710,40): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    -----CompilerOutput:-stderr----------
    -----EndCompilerOutput---------------
    - Finished compile Library/ScriptAssemblies/UnityEngine.TestRunner.dll in 1.536393 seconds
    - Finished script compilation in 1.587601 seconds
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\CanvasUpdateRegistry.cs(3,22): error CS0234: The type or namespace name 'Collections' does not exist in the namespace 'UnityEngine.UI' (are you missing an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\GraphicRebuildTracker.cs(3,22): error CS0234: The type or namespace name 'Collections' does not exist in the namespace 'UnityEngine.UI' (are you missing an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\GraphicRegistry.cs(2,22): error CS0234: The type or namespace name 'Collections' does not exist in the namespace 'UnityEngine.UI' (are you missing an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\CanvasUpdateRegistry.cs(86,26): error CS0246: The type or namespace name 'IndexedSet<>' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\CanvasUpdateRegistry.cs(87,26): error CS0246: The type or namespace name 'IndexedSet<>' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(17,75): error CS0246: The type or namespace name 'ILayoutElement' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\MaskableGraphic.cs(10,54): error CS0246: The type or namespace name 'IClippable' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\MaskableGraphic.cs(10,77): error CS0246: The type or namespace name 'IMaterialModifier' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\GraphicRebuildTracker.cs(13,16): error CS0246: The type or namespace name 'IndexedSet<>' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\GraphicRegistry.cs(13,45): error CS0246: The type or namespace name 'IndexedSet<>' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Graphic.cs(702,47): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(841,48): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(937,35): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\EventSystem\ExecuteEvents.cs(236,33): error CS0246: The type or namespace name 'ObjectPool<>' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(953,37): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(996,43): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(1074,34): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Mask.cs(19,60): error CS0246: The type or namespace name 'IMaterialModifier' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(1318,29): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(1329,29): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Image.cs(1380,35): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\InputField.cs(26,9): error CS0246: The type or namespace name 'ILayoutElement' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\RectMask2D.cs(23,44): error CS0246: The type or namespace name 'IClipper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\MaskUtilities.cs(140,58): error CS0246: The type or namespace name 'IClippable' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\RawImage.cs(132,48): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\ScrollRect.cs(18,159): error CS0246: The type or namespace name 'ILayoutElement' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\ScrollRect.cs(18,175): error CS0246: The type or namespace name 'ILayoutGroup' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\RectMask2D.cs(301,34): error CS0246: The type or namespace name 'IClippable' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\RectMask2D.cs(320,37): error CS0246: The type or namespace name 'IClippable' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\RectMask2D.cs(26,26): error CS0246: The type or namespace name 'RectangularVertexClipper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\RectMask2D.cs(35,25): error CS0246: The type or namespace name 'IClippable' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Text.cs(10,42): error CS0246: The type or namespace name 'ILayoutElement' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Graphic.cs(173,49): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\Text.cs(641,48): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\InputField.cs(2618,36): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.ugui@1.0.0\Runtime\UI\Core\InputField.cs(2710,40): error CS0246: The type or namespace name 'VertexHelper' could not be found (are you missing a using directive or an assembly reference?)
     
  3. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,204
    Close Unity
    Delete all CSproj files in the root of the project
    Open Unity
    Go to preferences -> External Tools
    Make sure Visual Studio (VS) is selected for external script editor
    Select Embedded, local, registry and built-in (others if you use them)
    Click regenerate project files
    Start VS/edit script
    Should be fixed
     
  4. sera0506

    sera0506

    Joined:
    Apr 1, 2014
    Posts:
    7
    Thank you for the advice~
    I found the problem,
    The reason is that the system blocked some of the downloaded packets.
    Lead to incomplete ugui loading
     
    SquallLiu and DevDunk like this.
  5. pazgametester

    pazgametester

    Joined:
    Sep 23, 2021
    Posts:
    1
Thread Status:
Not open for further replies.