Search Unity

Scripts don't compile in unity after bad re-importing of project files for later version of unity

Discussion in 'Scripting' started by unity_LUbQ6QyiZDNLzQ, Jun 18, 2019.

  1. unity_LUbQ6QyiZDNLzQ

    unity_LUbQ6QyiZDNLzQ

    Joined:
    Mar 17, 2019
    Posts:
    5
    As the title say, scripts just stopped compiling after re-import or recalculation when updating project for newer unity version. The project itself is running fine on build and in editor, the scripts that where re-imported are somehow working perfectly, but the new scripts that I create don't compile.

    I did a bad thing and instead of updating existing unity 2018 version I installed a new one on a hub this time, because I wanted to get a build exporter for mac's module, which makes my case of re-import a bit particular, but maybe it is not problem with re-import at all and I am completely clueless. One thing is for sure, new scripts dont compile after event - using project on a different version of unity.

    I also had accident of relocating project files, but I restored, maybe I left bits and pieces.
     
  2. WallaceT_MFM

    WallaceT_MFM

    Joined:
    Sep 25, 2017
    Posts:
    394
    Sometimes updating is just a bit buggy. Try deleting your Library folder (it's not under Assets, you have to delete it from the filesystem). That will force Unity to rebuild its database. This is a safe thing to do; they Library is mostly a cache to help the editor run faster, and Unity will rebuild it when it realizes it's missing.
     
  3. unity_LUbQ6QyiZDNLzQ

    unity_LUbQ6QyiZDNLzQ

    Joined:
    Mar 17, 2019
    Posts:
    5
    If I was more patient and listened I would do this exact thing, but what I did was copy paste all the folders from a new working project to the main problematic project thinking unity will figure things out, I hope copy pasting folders such as logs and Packages and Library wouldn't be a problem for unity ? In any case I will report what is the end result. The project is fairly big so it will take some time.
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    You should be making backups of your project regularly, especially prior to big changes such as upgrading Unity versions. Or you should be using version control. Anything not backed up is one mistake, hardware failure, or cosmic ray away from being lost.

    The normal way of resolving this type of issue would then be just reverting your changes using version control, or restoring from your last backup - wasting all of 20 minutes of your time at the most.

    But since it is too late for that, you should post your specific errors regarding why scripts aren't compiling, as how to resolve the problem depends on what those errors are. For example, you might be using .js code, which was still possible in 2018.2.x but is not in 2018.3+. If that was the case, you'd resolve the problem by converting all .js files to .cs files. You might also have code which uses Unity API's which have been removed in the later version, in that case you'd figure out exactly what code is causing the problem (says so right in the error), research what the replacement is (if any), and rewrite or remove the problem code. etc, etc.
     
  5. unity_LUbQ6QyiZDNLzQ

    unity_LUbQ6QyiZDNLzQ

    Joined:
    Mar 17, 2019
    Posts:
    5
    I have a backup from 10 days ago. It takes immensely long time to make backups for me. What I will do is copy this backup again try to port in the new unity version and see if my codes can be compiled. In last 10 days I was working 80% on codes and build's, so not much progress is lost. Oh yea as a report:
    I got 999+ errors mostly due to not recognizing or missing meta files so that thing I did is screwed for sure.
     
  6. unity_LUbQ6QyiZDNLzQ

    unity_LUbQ6QyiZDNLzQ

    Joined:
    Mar 17, 2019
    Posts:
    5
    Ok so in any way or form porting project to new unity made scripts no longer compilable. I took a fresh backup and got the same no compiling result. But What I love about unity is that I cna take those scenes and put them in new project and place all the assets manualy. It will take me a day, but the work is just placing files.