Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug ARFoundation package makes unity rebuild all scripts everytime I refocus the Unity Editor

Discussion in 'AR' started by Bersaelor, Apr 9, 2021.

  1. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    110
    Anytime I tap on the unity icon in the dock, it rebuilds all scripts. I don't need to change anything, just click on my browser, bring unity back into focus and bam, have to wait again.

    The error is in
    Code (CSharp):
    1. The package cache was invalidated and rebuilt because the following immutable asset(s) were unexpectedly altered:
    2.   Packages/com.unity.xr.arfoundation/Runtime/AR/ARPointCloudManager.cs
    3.   Packages/com.unity.xr.arfoundation/Runtime/AR/ARCameraBackground.cs
    4.   Packages/com.unity.xr.arfoundation/Runtime/Unity.XR.ARFoundation.asmdef
    5.   Packages/com.unity.xr.arfoundation/Runtime/AR/ARMeshManager.cs
    6.  
    Is anyone else seeing this issue?

    Unity 2021.1.2f1, ARfoundation 4.1.7

    PS: This is especially annoying because sometimes when I see the `rebuilding scripts` progress bar, I immediately click my terminal or Sourcetree or Visual studio to check something and when I click unity again the process will start all over again. I am no longer able to leave the unity editor unless I want to wait 20s after switching windows back.
     
    Last edited: Apr 9, 2021
  2. bostonvaulter

    bostonvaulter

    Joined:
    Jan 14, 2021
    Posts:
    15
    Hmm, I don't run into that issue. But I wonder if iCloud backups (if you're on a mac) or some other backup system is interacting poorly with those files.

    You can disable "Auto Refresh" in the general menu but then I think you need to remember to manually refresh your code.
     
  3. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,128
    Oops, I'm almost sure the AR Foundation Editor Remote is to blame here. My plugin modifies these scripts so they can work in the Editor.
    I'll try to address this issue in the next version, but here is a temporary workaround: please COPY the AR Foundation package from the Library/PackageCache folder to the Packages folder. This will prevent Unity to revert the folder's contents. Please make sure you COPY the folder and NOT move it.
     
    Bersaelor likes this.