Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

"The project you are opening contains compilation errors" When creating new project

Discussion in 'Getting Started' started by OrangeWind, Nov 30, 2022.

  1. OrangeWind


    Nov 29, 2022
    The problem I'm facing is: Evertime I try to create a totally new project or open a official example project should contain no error, the Unity will say the there are compilation errors in my project, just like the screenshot below:
    And this situation will happen in any different version of Unity, I have tried these versions: 2021.3.14, 2020.3.42, 2020.3.25, 2019.4.40.
    And the error messages in console of each version are different, in 2021.3.14:
    (This kind of disorderly code should be Chinese I think, the reason maybe the Chinese encoded question in Unity.. But I don't know why, because the Unity Hub and Unity I installed are all from UK website)
    In 2020.3.42 and 2020.3.25:
    And in 2019.4.40 the error message is just like the error message in 2020 version, just the "Compiler version 3.5.0-dev" changes to "Compiler version 2.9.1" (I don't have the screenshot cause I have deleted the 2019 version).
    >>Here I'll explain the process I download and install Unity:
    I just have an anaconda preinstalled in my computer(which is related to the Unity), and for the first time, I also have the Visual Studio2019 installed in my computer(But I try to uninstall VS2019 before install Unity later, it doesn't work). And I download and install the Unity Hub from official website, then install the Unity 2021.3.14 in Unity Hub. That's all the process, I didn't change anything else in the system about Unity. (There is actually one another thing I have done, but I don't think it's a reason. I download the ml-agents plugin in github, and created a new anaconda environment for it, with just python3.6 and pytorch and ml-agents installed. Then I try to add ml-agents in Unity's packages even it's in compilation error state.)
    >>Here is some info about my computer:
    UK computer with Windows11, with anaconda, some jdk and SQL installed.
    >>And here is the list of things I have tried, all from internet:
    1. Change the "Api Compatibility Level*" in Edit->Project Settings->Player->Other Settings->Configuration
    2. Download different version of Unity(as mentioned above)
    3. Delete some packages that may cause this problem
    4. Reimport all the assets of the project
    5. Delete the Unity_lic.ulf file in the directory: C:\ProgramData\Unity and let Unity reload it
    6. Somebody says this may be caused by some antivirus program, so I removed all the antivirus program on my computer (except virus defense program of win11, cause I don't know how to close it and I think it is better to not close it), and completely remove all the Unity files on my computer (probably, I don't know), the remove steps are:
    1) Delete the Unity Editor and Unity Hub files directly
    2) Delete temporary file related to Unity:
    3) Remove all the Unity related folders in windows registry(to ensure the thing I'm saying, to open this, press win+R, then type"regedit"):
    And reinstall the whole Unity in a totally different directory, to avoid the Unity influenced by the folder path name(like too long, or contains Chinese character), I create a new folder F:\Unity, and create four folder"Download", "Editor", "Hub", "Project" to hold download tem files, Unity Editor, Unity Hub and project file respectively. Then I download and install Unity Hub, then install Unity Editor in Unity Hub, create new project, and everything don't change...
    P.S. I also download a Unity use the same process as me on the computer of my roommate. His computer is also win11, with anaconda and Visual Studio preinstalled. And everything went right, it just took me several minutes to successfully create a new project.