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

Bug Fix unity engine compiler errors?

Discussion in 'Editor & General Support' started by CassClay, Jan 4, 2023.

  1. CassClay

    CassClay

    Joined:
    Mar 21, 2020
    Posts:
    20
    Finished my project about 2 weeks ago. Let it stay for a while to see when I start it with fresh eyes there's something out of order. What's out of order is Unity telling me to fix compiler errors within scripts of something Unity Engineers wrote. It's like my project got an expiration date on it I wasn't aware of. All of a sudden I left perfectly working project, only to launch the editor few weeks after and give me compiler errors about something I did not touched. Why? This is like some digital schizophrenia.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    Did you try a reimport-all?

    Beyond that, what are the errors? If they're in packages, perhaps this is in play.

    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.

    Sometimes the package system gets borked from all this unnecessary churn and requires the package cache to be cleared:

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

    Remember: NOBODY here memorizes error codes. That's not a thing. The error code is absolutely the least useful part of the error. It serves no purpose at all. Forget the error code. Put it out of your mind.

    The complete error message contains everything you need to know to fix the error yourself.

    The important parts of the error message are:

    - the description of the error itself (google this; you are NEVER the first one!)
    - the file it occurred in (critical!)
    - the line number and character position (the two numbers in parentheses)
    - also possibly useful is the stack trace (all the lines of text in the lower console window)

    Always start with the FIRST error in the console window, as sometimes that error causes or compounds some or all of the subsequent errors. Often the error will be immediately prior to the indicated line, so make sure to check there as well.

    Look in the documentation. Every API you attempt to use is probably documented somewhere. Are you using it correctly? Are you spelling it correctly?

    All of that information is in the actual error message and you must pay attention to it. Learn how to identify it instantly so you don't have to stop your progress and fiddle around with the forum.
     
  3. CassClay

    CassClay

    Joined:
    Mar 21, 2020
    Posts:
    20
    You see it's one of those random digital spirit possessions where it stopped working after not touching for two weeks. Literally that. Looking at the errors at hand I found out I have to reinstall JDK, NDK and gradle, just to be on the safe side did not used any of the last deployments, checked everything is in order and it still didn't solve it for me. Then uninstalled Unity, it took far too long and not sure but could of just restarted my pc midway and slap fresh install on top just to be warned by a message that the evil spirit is running Unity and installation could not complete. Closed the installer and Unity ran itself, it did compile this time, however to be on the safe side did another wipe and reinstall. How midway install halted and dropped and Unity started on it's own presumably missing half of it's functionality is beyond me.