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.
  2. Dismiss Notice

Resolved Unity Editor 999+ 'namespace does not exist'

Discussion in 'Editor & General Support' started by adbouldi, Jan 25, 2022.

  1. adbouldi

    adbouldi

    Joined:
    Feb 5, 2018
    Posts:
    3
    Hey All,

    This is a very random and frustrating occurrence that I have run in to. Firing up Unity a couple days ago to work on a project, I was faced with a prompt to launch in to safemode to fix compiler errors ~ strange, I didn't leave any when I last saved the project. When I entered safemode I was presented with 999+ compiler errors telling me that many of the default namespaces did not exist anymore (figure below).

    upload_2022-1-25_10-14-54.png

    My current steps I've attempted to find the source of the problem.
    - Opened a separate project - same issues.
    - Created a new project - same issues.
    - Rebuilt project files - same issues.
    - Reimported all assets - same issues.
    - Uninstalled/reinstalled VStudio - same issues.
    - Uninstalled/reinstalled Unity - same issues.

    I'm at my wits end right now, I would appreciate any and all input!
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,713
    It's very frustrating, sorry to hear you had to tangle with it.

    It looks likely to be another case of this:

    Extra unwanted packages in new projects (collab, testing, rider and other junk):

    https://forum.unity.com/threads/temp-unityengine-testrunner-dll-error.1133938/#post-7287748

    About the fastest way I have found to make a project and avoid all this noise is to create the project, then as soon as you see the files appear, FORCE-STOP (hard-kill) Unity (with the Activity Manager or Task Manager), then go hand-edit the Packages/manifest.json file as outlined in the above post, then reopen Unity.
     
    adbouldi likes this.
  3. adbouldi

    adbouldi

    Joined:
    Feb 5, 2018
    Posts:
    3
    Thanks for responding Kurt!

    I followed the process and it solved quite a few issues, however, there are still 122 compiler errors.

    Do you know what the source of this error is? It randomly occurred, and I'd prefer not to have to go through this process every time I create a new Unity Project...

    Thanks again, this was a huge step in the right direction.

    upload_2022-1-25_12-54-8.png
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,713
    I don't... but perhaps there's still some remnant of that useless nunit thing causing issues? Google up for how to clear package cache. Alternately, close Unity and blow away the Library/ subfolder within your project and then reopen Unity.

    You and me both. It's absolutely maddening and the trend is not getting better. I gave up and when I make a new project I just do the make-launch-force-kill-prune. I usually just copy over a culled-out manifest.json from an existing project. So much wasted time downloading, compiling, then having errors. It's infurating.
     
    adbouldi likes this.
  5. adbouldi

    adbouldi

    Joined:
    Feb 5, 2018
    Posts:
    3
    I found a solution! Looks to be a package cache error, which I guess explains why reinstalling Unity didn't do anything?

    Just navigate to your ~AppData/Local/Unity/cache/packages/packages.unity.com and delete all the folders and files within it. Allow Unity to recompile the cache and it should solve the problem (at least it did for me).

    Solution found here:
    https://stackoverflow.com/questions/53145919/unity3d-package-cache-errors/69779122


    Thanks a ton Kurt, I really appreciate your help with this!
     
    Kurt-Dekker likes this.
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,713
    Awesome and you're welcome. I'm going to take your link and add it to the bottom of my unwanted packages blurb.

    I really love the Unity3D game engine so it pains me when new users struggle with silly marketing decisions like spamming every user with 27 packages they don't need... and then they can't compile!

    Stick to Unity3D, you'll love it. It's a BEAST!
     
  7. MikeBastien

    MikeBastien

    Joined:
    Apr 24, 2009
    Posts:
    139
    Amen to that!

    It boggles the mind...
     
  8. joonturbo

    joonturbo

    Joined:
    Jun 24, 2013
    Posts:
    75
    Just in case someone is still looking for a solution...
    in our case this was caused by not having git LFS installed, meaning all files are there at first glance, but some of them are just references to an LFS file that GIT doesn't know (like .dll files) which causes a flood of namespace errors.

    TLDR: If you have this problem, and you are using GIT, ask whoever is in charge if it uses GIT LFS.