Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

UWP Build is getting perpetually stuck on Gathering Build Data or Importing Assets?

Discussion in 'Windows' started by tague, Mar 16, 2021.

  1. tague

    tague

    Joined:
    Oct 2, 2018
    Posts:
    8
    I'm working on Unity 2020.3.0f1, targeting UWP ARM64 devices and using Microsoft's MRTK. I'm dealing with constant delays in the editor that make it impossible to do my job.

    Nearly every time I attempt to build my application, the build will get stuck perpetually (and I mean it - I left one of these waiting until it said "busy for 7:00:00" a few days ago) on either:

    - Gathering Build Data...
    - Importing Assets... (No idea why this would trigger on build, but it does)

    There are nearly no assets in my project and most of my changes between builds consist of small scene changes or script changes.

    Before manually disabling all automatic importing and asset refreshing, there was also essentially a random chance I would get bricked out of Unity by infinite "Importing Assets..." every time I alt-tabbed back into Unity.

    I don't experience this kind of delay on other Unity projects. As I write this, Unity has been "Gathering Build Data" for 11 minutes straight. Any workarounds to make Unity behave just a little while working on this project? A way to cancel out of these dialogs without terminating unity entirely, at least?
     
  2. timke

    timke

    Unity Technologies

    Joined:
    Nov 30, 2017
    Posts:
    408
    Hey, thank you for posting this problem. I don't think this is a known issue, and so please file a bug for it.

    Since you're using MRTK, I strongly recommend you also post this issue on Microsoft's HoloDevelopers Slack channel (if you haven't already), which you can join via this link: https://holodevelopersslack.azurewebsites.net/. You might get better help there.

    Yeah that shouldn't happen.

    It sounds like something within the project (possibly within MRTK itself) is modifying an asset file or generating a new file under the Assets folder during the build process, which kicks off the Asset Importer.

    Is there anything you can think of that might be writing to the Assets folder during the build?
    Does the Editor log show any Asset file activity prior to Importing Assets showing?
     
  3. tague

    tague

    Joined:
    Oct 2, 2018
    Posts:
    8
    Hi, I've just narrowed this down a bit - it's almost definitely an issue with MRTK and not Unity itself. It triggers most often when using MRTK's Build panel rather than Unity's built-in Build window (which I had been avoiding because of earlier massive build issues, but which now seems to work just fine). It's possible that 'Importing Assets' perpetually is still a problem during alt-tab, but as I've disabled automatic importing due to the project being unusable otherwise, I won't really know. Other than that, the best workaround is to stay away from MRTK when possible. I've been using it for weeks and this sort of weird build behavior crops up on the daily.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,756
    Is Unity using any CPU while stuck like that? Or does it show up idle in the task manager?
     
  5. tague

    tague

    Joined:
    Oct 2, 2018
    Posts:
    8
    I just managed to trigger the 'perpetual import' again by re-enabling Auto Refresh and Directory Monitoring - Unity and all its subprocesses just sit there for all eternity at 0% CPU and 0 MB/s disk usage (the project window process will occasionally rise to around 0.1% CPU and 0.1MB/s disk usage just for the sake of tormenting me, but it never accomplishes anything!)

    Checking the logs during this activity, all that I can see is a good amount of this, but it appears to be from prior to getting stuck as it hasn't added anything new for the past 5 mins.

    Code (CSharp):
    1. Refresh completed in 0.004981 seconds.
    2. RefreshInfo: RefreshV2(AllowForceSynchronousImport) scanfilter:
    3. RefreshProfiler: Total: 4.815ms
    4. Refresh completed in 0.005584 seconds.
    5. RefreshInfo: RefreshV2(AllowForceSynchronousImport) scanfilter:
    6. RefreshProfiler: Total: 4.694ms
    7. Refresh completed in 0.004881 seconds.
    8. RefreshInfo: RefreshV2(AllowForceSynchronousImport) scanfilter:
    9. RefreshProfiler: Total: 4.703ms
    10. Refresh completed in 0.005023 seconds.
    11. RefreshInfo: RefreshV2(AllowForceSynchronousImport) scanfilter:
    12. RefreshProfiler: Total: 4.799ms
    13. Refresh completed in 0.005540 seconds.
    14. RefreshInfo: RefreshV2(AllowForceSynchronousImport) scanfilter:
    15. RefreshProfiler: Total: 4.971ms
    16. Refresh completed in 0.005184 seconds.
    17. RefreshInfo: RefreshV2(AllowForceSynchronousImport) scanfilter:
    18. RefreshProfiler: Total: 4.914ms
    19. Refresh completed in 0.007103 seconds.
    20. RefreshInfo: RefreshV2(AllowForceSynchronousImport) scanfilter:
    21. RefreshProfiler: Total: 5.130ms
    22. Refresh completed in 0.004841 seconds.
    23. RefreshInfo: RefreshV2(AllowForceSynchronousImport) scanfilter:
    24. RefreshProfiler: Total: 4.649ms
    25. Refresh completed in 0.007813 seconds.
    26. RefreshInfo: RefreshV2(AllowForceSynchronousImport) scanfilter:
    27. RefreshProfiler: Total: 4.612ms
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,756
    Can you find Unity process in the task manager, right click it and click "Create Dump File"? Then zip it up and send it to me.
     
  7. tague

    tague

    Joined:
    Oct 2, 2018
    Posts:
    8
    Struggling to make it happen once again - having that age-old issue of being unable to reproduce a bug just after telling others about it! I'll reply again with a dump when I manage to make the editor do its thing again.
     
  8. tague

    tague

    Joined:
    Oct 2, 2018
    Posts:
    8
    Hello, I've managed to trigger the issue and create a dump. What is the best way to send a dump directly? I'd rather not share it publicly on the forum.
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,756
    Compress it to a zip file and then put it on google drive/onedrive/dropbox and PM me a link.
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,756
    Hey, thanks for that dump. It seems like for some reason, something is calling "EditorUtility.DisplayProgressBar" and forgets to call "EditorUtility.ClearProgressBar". Unfortunately, it's not clear whether it's something on Unity's side or on your project's side.

    Could you search for "ProgressBar" code in your C# scripts (including all used packages)?

    If nothing comes up, could you report a bug and work with our QA to help us reproduce this so we could fix it?
     
  11. tague

    tague

    Joined:
    Oct 2, 2018
    Posts:
    8
    Thanks for that lead, looks like it's probably a bug in the Mixed Reality Toolkit and not on Unity's end - I can find several instances where it calls `DisplayProgressBar` and fails to clear it at any point afterward, but these only occur in build-related code - I'm not sure why it happens sometimes during regular alt+tabs.
     
  12. myfiteasy

    myfiteasy

    Joined:
    May 9, 2021
    Posts:
    4
    I am facing similar issues where the UWP build process doesn't complete. It gets stuck for hours at (Building player - checking requirements). Although checking task manager shows that the process takes 0% CPU. Kindly help.
     

    Attached Files:

    • 1.PNG
      1.PNG
      File size:
      46.6 KB
      Views:
      294
  13. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,756
    That sounds bizarre. Can you capture a dump file for the Unity editor and send it to me? You can capture it by finding Unity.exe in the process list in the task manager under Details tab, right clicking it and pressing "Create dump file". Make sure to compress it to a .zip or .7z file before uploading it as it will make it much smaller!
     
  14. myfiteasy

    myfiteasy

    Joined:
    May 9, 2021
    Posts:
    4
    Thank you for your reply. As I looked at Task Manager, there were two processes running Unity.exe, as shown in the attached picture. I have uploaded the zip dump files in a Google drive and shared with the link to those in a private message.
     

    Attached Files:

    • 123.PNG
      123.PNG
      File size:
      74 KB
      Views:
      284
  15. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,756
    OMG... you found a really nasty bug. We have an O(m * n²) loop where "n" is the file count in your build and "m" is assembly count in your build. Since your project has a lot of files in the build, it just takes forever. I'm preparing a fix for this. I don't see how you can work around it unfortunately. This regression has been introduced in 2020.1 and has gone unnoticed since :confused:.
     
  16. myfiteasy

    myfiteasy

    Joined:
    May 9, 2021
    Posts:
    4
    Thank you for the quick turnaround. We are waiting eagerly for the fix. Keeping fingers crossed.
     
  17. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,756
  18. myfiteasy

    myfiteasy

    Joined:
    May 9, 2021
    Posts:
    4
    Ok that's good news. Since I use 2020.3, I will need to wait for the patch.
     
  19. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,756
    Hi, the fix will be in Unity 2020.3.23f1, which should be released next week.
     
  20. saikiran007

    saikiran007

    Joined:
    Oct 2, 2017
    Posts:
    1
    Hi, I'm still facing this issue with Unity 2020.3.251, any workarounds?
     
  21. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,756
    I suspect you may be running into a totally different issue because the original issue was fixed. Could you also capture a dump file and send it to me?