Search Unity

Hundreds of compiler errors, how to fix?

Discussion in 'Editor & General Support' started by FortunePilotSam, Dec 29, 2020.

  1. FortunePilotSam

    FortunePilotSam

    Joined:
    Dec 29, 2020
    Posts:
    2
    Hi,

    I've been having problems compiling any project (new blank projects included) because I'm getting hundreds of compiler errors, 447 to be specific.

    All of these errors originate from one of these two paths:
    Library\PackageCache\com.unity.test-framework@1.1.19\UnityEngine.TestRunner\TestRunner\...
    Library\PackageCache\com.unity.test-framework@1.1.19\UnityEngine.TestRunner\NUnitExtensions\...

    and are ONLY one of these types of errors:
    "The type or namespace name _Something_ could not be found",
    "_SomethingMethod_: No suitable method found to override",
    "Attribute _something_ is only valid on classes derived from _Class.something_".

    I have already tried these possible solutions:
    Deleting the PackageCache folder to let Unity reimport them, to no avail,
    Help->Reset packages to default,
    Completely removing Unity and reinstalling it.

    Does anyone know what is going on and how to fix these problems?
    Many thanks in advance!

    ~FortunePilotSam
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Both of those errors are related to the Test Framework package. Just remove the Test Framework package. Click "Window->Package Manager", click on that package, then in the bottom right click the remove button.

    I have no idea why Unity includes the Test Framework package by default in new projects. It is a feature for more advanced users, and is more likely to be used in larger projects with extensive planning. Novices or fairly small projects are unlikely to use this package, and the larger or well planned projects can easily fit "install the Test Framework package" into their planning.

    Same thing with the Unity Collaborate package. You don't need it unless you're using the Collaborate service, and most projects aren't so don't need it. But It is there by default with its only use for me to potentially generate compile errors :p
     
  3. FortunePilotSam

    FortunePilotSam

    Joined:
    Dec 29, 2020
    Posts:
    2
    Thanks for the quick response, saved my day!
    In my case, I also had to remove a package called 'Rider Editor' before I could remove 'Test Framework' as it was a dependency.

    Happy Holidays!

    ~FortunePilotSam
     
    Joe-Censored likes this.
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Yeah I always remove the Rider Editor package too, since I use VS instead of Rider, so didn't realize there was a dependency. Glad you got things working!