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. Response avatar

    Resolution Note (fix version ):

    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 (10)

  1. A8feeeb928ae1f50ca8ce8956bae02fa?d=mm

    marianpekar

    Dec 01, 2019 19:24

    I had this issue on 2019.2.14f, I tried (in this order):

    - close and open the project again. It didn't help
    - close, delete manifest.json and open again. It didn't help.
    - close, clean project using git clean -fdx*, then open again and let Unity recreate all those cleaned files. It didn't help either.
    - upgrade project to 2019.3.0f1. That **FIXED** the issue

    *) I'm using this gitignore file: https://github.com/github/gitignore/blob/master/Unity.gitignore

  2. C1de3bcda05e029f6c53e24e9c0868e0?d=mm

    AlexChacon2341

    Oct 29, 2019 00:44

    I've tried everything short of reimporting all assets, but nothing has worked, including:

    - Deleting the manifest.json file
    - Deleting specific UI references in manifest.json
    - Re-importing Unity UI in the package manager
    - Switching versions of Unity 2019.2

    Was anyone able to fix this issue any other way?

  3. 4992a119a68a33a3ab2611b73da80268?d=mm

    Bradamante

    Oct 26, 2019 13:09

    I had this happen to me recently with Unity 2019.2.9f1 on macOS. I just started a new LWRP project, downloaded and imported an asset from the Asset Store and the scripts from that asset complained that UnityEngine.UI wasn't there. Restarting the editor did not help, deleting the Packages/manifest.json file did.

  4. Ded8f69d96bf9b50745fe2d4d8d6c3e8?d=mm

    mikevargas

    Oct 07, 2019 23:27

    For the poor souls who are running across this page in a desperate attempt to fix the current issue (as of 10/7/2019) and came up short, as of 2019.3.0b6, the solution for me was to delete the Packages/manifest.json file, and things will reload properly. You're welcome.

  5. Ace015e55d129bbe4dab9ef5072be4a1?d=mm

    Dover8

    Oct 01, 2019 14:50

    Happened to me today when I updated a project to the current beta (2019.3.0b4). Resolved by removing the Unity.UI packages (and all its dependencies) in the package manager, then re importing them.

  6. 9b332fc3fc5f2bba1eea6a1cc2dbb621?d=mm

    msefranek

    Sep 02, 2019 14:12

    This is still a problem for me with version 2019.3.0a5 alpha. I also do not have a "UnityEngine.UI.dll" from another project.

  7. 5316750e6633b48cecf3fd9fb74784df?d=mm

    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.

  8. Bf39d473204c8f9c51ee4cbfeaf63ecb?d=mm

    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

  9. Bf39d473204c8f9c51ee4cbfeaf63ecb?d=mm

    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

  10. 27cb35316df01975c84bec8531227926?d=mm

    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.