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

Question Why every time I updgrade Unity to a major release it does reimport everything 3 times?

Discussion in 'Editor & General Support' started by 00christian00, Sep 1, 2023.

  1. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,032
    I am working on a mobile project and stay on the Android platform most of the time. Whenever I decide to upgrade Unity, for example from 2021 to 2022, it does reimport everything 3 times.
    The first one is the normal import, but I don't know why it always change to Windows platform after the first upgrade.
    So I switch to Android and there is a new full import because I switched platform.
    After this there are the usual script errors due to Api changes, I fix them and after finishing compilation it reimport everything again!
    Is this normal?! Luckily my project is not huge but it's not small either, every import is around 20 minutes, multiply by 3 it becomes an hour...
    I cannot imagine the pain of people working with big textures.
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    Sounds like:

    1. Compiles for windows, as that's the platform you're working on
    2. Compiles to android, as that's what you develop for
    2.1 encounter issue preventing compilation
    3. Issue fixed, now do the compilation properly


    Luckily much of this is cached and only a one time thing per Unity version
     
  3. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,032
    It's not the compile time that bother me, but the import time. Why it needs to import for Windows? And why it need to import 2 times for Android? It's reimporting all the assets, texture and models.
     
  4. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,032
    Plus I don't think it's a requirement, because otherwise it should do the same on a new project, but if I create a new android project and copy the same assets in that one, it will only import once. But then I will have to set all the project settings again.
     
  5. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    For windows probably because you are running the editor on a windows PC.
    Not sure exactly why however.

    The 3rd one sounds like it is because it encoutered an issue, after that's fixed it can import property.

    I meant import when I said compile in my first reply.

    If you think it's a bug, file a bug report
     
    00christian00 likes this.
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    10,977
    Delete the library before upgrading, make sure you set the platform in the hub to the correct one before opening
    upload_2023-9-1_16-50-47.png

    be prepared for this to be a multi-hour process. One theory for why the 3rd time happened, is if you have any asset post process scripts that do stuff to textures or meshes, so Unity tries to compile stuff but has an error, but compresses everything anyway, then once the error is fixed the script runs and everything needs to be imported again.

    It is a good idea to have a dummy project you can open quickly so you can disable the "compress on import" option (IMO, there should be an easier way to change this, maybe through the hub?), then do the upgrade, once you fixed all the errors then re-enable compression.
     
    00christian00 and DevDunk like this.