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
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.
Comments (24)
-
ksakins
Feb 05, 2020 14:31
This is super frustrating. After migrating from 2018.3 to 2019.3, all of the sudden tons of prefabs are missing script references. Not all of them are related to UI either. I've seen this happen before when updating Unity versions, and it's pretty lame that this issue is still present after years.
Not only that, but the reporting of missing scripts is horrific. All the error does is tell you that there is a script missing, but if you have dozens of missing scripts, that does absolutely no good unless you memorize which scripts are attached to which prefabs.
-
as87dgs6asg0a
Feb 03, 2020 00:04
Funny how you ignored this as a problem and now it's on the F branch. Which of course being the professionals you are, also ignored:
https://issuetracker.unity3d.com/issues/missing-namespace-ui-error-appears-when-a-script-tried-to-use-unityengine-dot-ui -
tomblind
Jan 29, 2020 21:24
Just upgraded from 2019.2.12f1 to 2019.3.0f6 and am having the same issue.
VSCode gives the error:
"The type or namespace name 'UI' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)"
on "using UnityEngine.UI", and all references to UI types are also giving errors.
I've tried removing everything and re-installing but no luck. -
john-mighty
Jan 16, 2020 21:44
I just hit this as well. I upgraded a project from 2019.2.17 into 2019.3.0f5 and lost UnityEngine.UI.
-
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
-
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.2Was anyone able to fix this issue any other way?
-
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.
-
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.
-
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.
-
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.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Performance decreases significantly when instantiating a Prefab with many children
- "MissingReferenceException" error is thrown when creating a new "Standard (URP)" scene
- Silent crash when opening a specific project
- "+" shaped artifacts are rendered on UI Toolkit Buttons when the border radius is over 50%, button's opacity is set to 1 and the border has width
- All references to Sprite Atlas and AssetReferenceAtlasedSprite are removed when migrating Sprite Atlas Mode from V1 to V2
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.