Search Issue Tracker

Not Reproducible

Votes

1

Found in [Package]

Issue ID

1152478

Regression

Yes

Upgrading projects to 2019.2 Beta can introduce reference errors to UnityEngine.UI

Package: UGUI

-

UPDATE: As of recent backports, this issue can now be resolved with a reimport or restart of the editor. Is there a way we can automate this process for our users, so they are not caught trouble shooting and losing time to reimporting after the upgrade process is already done?

In 19.2 (as recent as 0b8), upgrading certain projects will introduce reference errors related to UnityEngine.UI. This has been encountered in *most* projects during Upgrade testing, however this is most easily seen in Scenario-pang (attached):

- Assets\Scripts\Ellen\CharacterController.cs(5,19): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
- Assets\Scripts\Ellen\CharacterController.cs(10,12): error CS0246: The type or namespace name 'Text' could not be found (are you missing a using directive or an assembly reference?)
- Assets\Scripts\UI\LifeController.cs(4,19): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
- Assets\Scripts\UI\LifeController.cs(8,13): error CS0246: The type or namespace name 'Image' could not be found (are you missing a using directive or an assembly reference?)

Additional information:

- As of recent backports, this issue can now be resolved with a reimport or restart of the editor.
- These errors do not occur if the same files and their dependencies are extracted into a new 2019.2 project.
- As of 2019.2.0b1, UnityEngine.UI (UGUI) has been extracted to a package

Steps to reproduce:

1- Download the attached projected
2- Open the project in Unity, electing to upgrade when prompted
3- Observe errors referencing UnityEngine.UI

Reproduced in 2019.2 as late as 0b8.

  1. Resolution Note:

    The issue is resolved in later 2019.2 non-beta builds and not present in 2019.3 and later.
    These references also need to be added to the*.Asmdef files in the project. This will resolve any issues, save for *.Asmdefs in packages which have not been updated accordingly.

Comments (24)

  1. surferboy2004

    Aug 08, 2019 15:28

    I did what DR4 said, and when I close the project and reopen it, the UnityEngine.UI.dll file disappears from the project.

  2. dr4

    Jun 08, 2019 21:16

    Please ignore my last comment, for some reason when I did that it make it look like UnityEngine.UI and removed the errors but it came back, in my case UnityEngine.UI was totally missing from the project, I had to copy it from another project:

    1 look for a file called "UnityEngine.UI.dll" in another project.
    2 copy that file in your current project
    3 in visual studio go to project > add reference > browse
    4 select the UnityEngine.UI.dll file, it will reference it and everything will work as usual

  3. dr4

    Jun 08, 2019 20:52

    I agree with ANDYBAK about the information...

    To fix it look for the file yourProjectName.Asmdef , open it with a text editor and in references add add:

    "references": [
    "UnityEngine.UI",

    clean, rebuild the project it should work now

  4. andybak

    May 27, 2019 11:51

    > These references also need to be added to the*.Asmdef files in the project.

    How about a bit more information? The docs for Assembly Definition files are pretty poorly written and hard to understand.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.