Search Unity

Bug Unity 2022.2.1f1 Build takes over 30 minutes Unity 2021.3.11f1 takes 3 minutes

Discussion in 'Android' started by apiotuch_unity, Jan 24, 2023.

  1. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    After importing a project into Unity 2022.2.1f1, my builds for Android take over 30 minutes, and utilizes all my system's RAM 32 GB and takes forever to release the memory. It prevents me from doing anything else while Unity 2021.3.11f1 would take an average of 3 to 5 minutes to build after the initial build. It doesn't happen to all projects, such as examples or new projects. Just the one I imported. Do I have to buy more RAM? Is there some service that I need to disable that Unity auto-enables in 2022.2?
     
    Last edited: Jan 24, 2023
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,902
    Do sequential builds also take 30 mins? Android switched to incremental build pipeline in 2021, thus only the first build is long, the sequential builds should be faster
     
  3. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    I use incremental builds for 2021, and I tried incremental and clean builds for 2022 which both take over 30 minutes for 2022.
     
  4. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    All sequential builds took over 30 minutes.
     
  5. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,902
    Could you attach editor.log and <project>\Library\Bee\buildreport.json?


    Alternatively, if you have Google Chrome installed, enter chrome://tracing and open buildreport.json, it can give you a hint where the time is spent when producing a build.
     
  6. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    It says the file is too large to upload, is there another channel I can send the build report to?
     
  7. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    The majority time is spent with the incremental build. I have the incremental player build selected in this screenshot:
    upload_2023-1-25_15-24-51.png
     
  8. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,902
    Could you create a bug with builderport.json attached, or if you can please attach a repro project if the issue reproduces constantly, since this is definitely a regression
     
  9. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    @Tomas1856 I submitted a bug report. Did you want the case #?
     
  10. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,902
    Yes, you can paste it here. Thank you
     
  11. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
  12. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,902
    I see from logs that you're compiling for all 4 android architectures, which means a lot of il2cpp cpp files are being compiled. They shouldn't get recompiled in sequential builds, if no changes to scripts are done.

    Did you use il2cpp + 4 architectures in 2021.3 too ?
     
  13. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    Yes, here is the 2021 configuration:
    upload_2023-2-2_13-38-22.png
     
  14. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    Another difference with 2021 and 2022 is that in 2021 MARS is not included, but in 2022 I did import the MARS package. I don't know if that makes a difference.
     
  15. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    Sorry, I also tried it without MARS in 2022 and it still had the slow builds.
     
  16. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    @Tomas1856 I haven't heard back from anyone for a while. No one seems to be responding with case IN-30640. I was wondering if the slow builds has anything to do with the way shaders are being built with unity 2022? I noticed in a recent video from GDC that was being worked on for LTS? Should I be looking at that? Has anyone on the Unity team been able to look at the latest I uploaded?
     
  17. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,902
    Sorry for the delay, I'll ask internally what's the status about that bug.
     
  18. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    my builds seem to take more than 1 hour, I dont get why this is so slow, iOS builds take 2 minutes in this machine. (MacBook Pro 2022, Sillicon)
    I pushed Build and run to debug on the device but still.... 1 hour waiting.

     
  19. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,902
    The bug above is still being investigated, but there's a file in <UnityProject>/Library/Bee/buildreport.json which contains info where the time gets consumed, please attach it to thread. Alternatively you can open this file in Google Chrome, enter
    Code (CSharp):
    1. chrome://tracing/
    in address bar.
     
  20. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    Sent you a DM with the log.
    Thanks
     
  21. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    Just a wild guess but could have anything to do that I'm running on a mac sillicon ? @apiotuch_unity ? you on a Mac or PC?
     
  22. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,902
    (Replied)
     
  23. DJ_YelloW

    DJ_YelloW

    Joined:
    Jul 2, 2018
    Posts:
    1
    same here, 2021.3.5f1 takes less than 30 minutes to build
    2022.3.0f1 takes around 4 hours which made it impossible to work with.
    WebGL.

    any news?
     
  24. MstarAdmin

    MstarAdmin

    Joined:
    Nov 14, 2014
    Posts:
    2
    Currently the only thing that cuts down time (for Android) is to use the build option "Force skip data build" which is not available for all platforms; Instead of Build or Clean Build. That option basically skips rebuilding scenes and prefabs (I believe) which isn't very useful since we modify prefabs and create new ones between builds, that are not set as addressables. However it does cut down build time down to 2 or 3 minutes from 30 minutes and it doesn't gobble up all the machine's memory so other tasks can be performs on the machine while it builds. Using the default build option makes the machine unusable still with 2022.3.0f1.
     
  25. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    @Tomas1856 I have submitted multiple build reports for the original issue comparing 2021.3.11 and 2022.3.0. I have not heard a response yet. So far, force skip data build reduces build times in 202022.3.0f1 but it won't be useful for us since we modify and create new prefabs and scenes between builds.
     
  26. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    @pistoleta I am currently testing with a PC. I have not attempted Mac or other platform targets yet since this issue impedes our resources for other development tasks.
     
  27. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,902
    Do you have a case number?
     
  28. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
  29. Michael512

    Michael512

    Joined:
    Jan 26, 2015
    Posts:
    10
  30. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,142
    I have a similar issue with Unity 2022.3.4 (Apple Silicon) and Android build. For my project, incremental builds take 22 seconds on Unity 2021.3.27(Apple Silicon), but on Unity 2022.3.4 they take 90 seconds.

    As @Tomas1856 advised I opened the 'buildreport.json' file with 'chrome://tracing/', and it seems like the majority of build time is spent on the 'Prepare splash screen' phase.
    upload_2023-7-6_9-57-2.png
     
  31. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,902
    How much Prepare splash screen takes time? Anything special about your splash screen ?
     
  32. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    @Michael512 I haven't heard anything from Unity regarding this for over a month and basically nothing has been done except after 6 months of on and off troubleshooting, discovering that if I make absolutely no changes to the code and don't build any prefabs it will speed up building back to what 2021 already does with code changes and building prefabs... which is basically useless for a development setting obviously. I'm surprised that Unity advertises "improved workflows for Unity 2022.3" when it actually just halts them entirely. I'm sure most developers won't notice because their build times will be fast anyways, but for some, 30-45 minutes while completely locking up your machine basically eliminates iterative development for mobile platforms. They basically made it so you can't realistically test on mobile devices or do any work while you wait for your build to complete. I first discovered this issue back in January. And I reported it in February I believe. I am not always testing this since it prevents me from doing any actual work while testing. setting up the environment to run 1 test to completion usually takes half a day so obviously I am still on 2021 and will be for the foreseeable future since I don't believe Unity is actively trying to solve the over 6 month old issue introduced with 2022.
     
    Lorrak likes this.
  33. Lorrak

    Lorrak

    Joined:
    Sep 17, 2019
    Posts:
    50
    definitely longer build time with 2022.3, small project, literally just a few asset packs, with 2021.3 it took max 5min, now +15min even with mono scripting backend, building for android, urp, it looks like it packs shaders every time, will test more tomorrow with chrome
    -edit-
    well it took 585secodonds(9.7min) with IL2CPP, not so bad, but in 2021.3 I had ~285seconds
    the splash screen is default unity's
    the project in general is just a few asset packs, nothing serious
    @Tomas1856 I will send you log file
     

    Attached Files:

    Last edited: Jul 14, 2023
    KyryloKuzyk likes this.
  34. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,142
    Nothing special, just a default 'Unity logo' splash screen that comes with a free version of Unity.
     
  35. Lorrak

    Lorrak

    Joined:
    Sep 17, 2019
    Posts:
    50
    2021.3.29f this is amazing
    Build completed with a result of 'Succeeded' in 175 seconds (175168 ms). lol
    thank you Unity's dev team
     
  36. KalUnity3D

    KalUnity3D

    Unity Technologies

    Joined:
    Jul 17, 2020
    Posts:
    17
    Hi @GamePyro-com , this forum section is for Android only.

    If it is related to PS5, then you would need to sign up with them via partners.playstation.net and use support there.

    Thanks,
    - Kal
     
  37. Lorrak

    Lorrak

    Joined:
    Sep 17, 2019
    Posts:
    50
    so.. unity 2022.3.10f1 has again those long building times, gonna check later with google chrome, project is the same
    building for android

    2021.3.29f1 builds in ~80seconds

    2022.3.10f1 builds in minimum 530seconds
     
    AldeRoberge likes this.
  38. AldeRoberge

    AldeRoberge

    Joined:
    Jun 23, 2017
    Posts:
    60
    Same problem over here, 2022.3.10f1

    Takes AGES.

    upload_2023-10-10_23-37-20.png
     
  39. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,142
    I FOUND THE SOLUTION to the long 'Prepare splash screen' build phase in Unity 2022.3.11!!!

    It took me several hours to remove everything from my project, but the empty project build still took several minutes. So I narrowed the issue down to one obscure setting: 'Project Settings/Editor/Texture Compressors/ETC Compressor'. Setting this setting from 'Legacy' to 'Default' solved the issue for me. God bless!
    upload_2023-10-24_12-48-38.png

    Edit:
    More details. MacOS Activity Manager showed 100% CPU load on PVRTexTool, so this helped me narrow down the issue to the texture compression.
     
    Last edited: Oct 24, 2023