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)
-
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.
-
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 -
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
-
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
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.