How to solve the error: "type or namespace UnityEngine.UI does not exist" in Windows
Hi,
We are trying to export our project for android and in the middle of compiling there is an error that says :
Assets/Scripts/GameController.cs(2,19): error CS0234: The type or namespace name UI' does not exist in the namespace
UnityEngine'. Are you missing an assembly reference?
and when we comment this line, we can not use 'Text' type for new ui system.
what should we do now and what is the answer?
Thanks
I started having this problem ever since upgrading to 5.2.2. When I hit F5 to debug in Visual Studio 2012, VS fails to compile the program (Unity compiles it fine). I had read that adding the "System.Web" reference to the project resolves that issue and indeed, when I was using Visual C# 2015, it did resolve it. But Visual C# 2015 crashes constantly and without warning, so I've gone back to 2012.
Except that VS 2012 won't let me add System.Web to my project and attempting to do so crashes Visual Studio 2012.
Dear Unity: what the hell is going on?
Answer by HyunMok_Moon · Oct 07, 2016 at 07:43 AM
I tried restart unity, but same. unity version is 5.3.4 I tried Asset->Reimport All. ( import other dlls, etc. ) It works.
Doing a Asset->Reimport All worked for me as well
Answer by Qasem2014 · Dec 17, 2014 at 07:45 PM
i have same problem , whats the version of your unity ? i use 5 and i get this error , then change it to 4.6 and its work !!! you can see my question in my profile
if you use 4.6 , go to mono develop and open "edit references" from "project" menu . if you don't see UnityEngine.UI in right hand of window , choose it from the list in left and add it to your references
Answer by tkamruzzaman · Oct 20, 2016 at 02:40 AM
Restart Unity, if this does not solve the issue Re-import everything.
Answer by CeerX · Apr 10, 2020 at 09:16 AM
If someone still has this problem and is using VS Code try to install the VSCode asset in the assets store
EDIT: Another more simpler solution i found was to downgrade Visual Studio Code Editor in the package manager to the version 1.1.3 + restart everything
(Window > Package Manager > Visual Studio Code Editor)
Your answer
Follow this Question
Related Questions
Android Build Issue: Unable to convert classes into dex format 1 Answer
Export FBX Model Runtime 0 Answers
unity--android-resource.jar does not exist in project imported to Eclipse 1 Answer
Help,the bugs in the game are still there after export 0 Answers
Cannot build Google Development Project 0 Answers