简体   繁体   中英

Unity 2019.2.* - Invisible/empty errors after trying to build

In short, for some reason I can not figure out, two empty errors appear in my log . These persist after clearing, on restart and occur in every project , both existing and new. Un- and re-installing Unity seem to have no effect whatsoever.

Unity 编辑器显示带有空错误问题的新空项目。

This issue started appearing for me in Unity 2019.2.1 and persists even after updating to the most recent 2019.2.14f1 . Because they are errors, they prevent me from running or building the project which means I am completely stuck and can not use Unity until I find a way to fix this. I am using Windows 10.

I have already submitted this issue to Unity, but I think it is an issue with my installation, so I don't know if they'll be able to help me.

The issue appeared in one project and seemed to be contained to that one project until I attempted to build another project. The moment I try to build a project, the issue appears and will persist no matter what I do. Even if a project is completely empty and brand new, the moment I attempt to build the project, the errors appear and the project becomes "cursed" with them.

Something that might be the cause, but might also be a symptom, is that scripts will indicate that they can not find UnityEngine. Is there any way to manually install those libraries?

Even after manually uninstalling Unity, Visual Studio and removing all references to Unity from AppData, then installing the most recent versions of Unity and Visual Studio, the issue persists.

I have not been able to test an affected project on a different computer, but I will update this question if I do. If Unity does get back to me with a solution I'll post that.


Edit:

The true cause of the issue was that for whatever reason, Unity could not find Roslyn. Hence why scripts were unable to compile, which resulted in the Unity Editor itself being affected.

I've added the solution to this issue as an answer to this question.

This issue has been solved with a response from the Unity team!

This is their solution:

Please try the following steps to fix the issue:

 1. Close any open Unity Editors
 2. Go to "C:\Program Files\Unity\Hub\Editor\(Your Unity version)\Editor\Data\Tools\RoslynScripts"
 3. Edit "unity_csc.bat" (You might have to run Notepad as an administrator to be able to save it)
 4. Replace the line that says "%APPLICATION_CONTENTS%\Tools\Roslyn\csc" /shared % with the following: "C:\Program Files\Unity\Hub\Editor\(Your Unity version)\Editor\Data\Tools\Roslyn\csc.exe" /shared %

Leaving it here for any future Google searches.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM