Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Bug Error: The process cannot access the file because it is being used by another process.

Discussion in '2022.1 Beta' started by mishakozlov74, Sep 24, 2021.

  1. mishakozlov74

    mishakozlov74

    Joined:
    Aug 8, 2018
    Posts:
    143
    From time to time, after building scripts I get this error. I didn't have it before, probably it's this related to this alpha?

    upload_2021-9-24_19-17-31.png

    If you want me to provide any additional information, just let me know.
     
  2. mishakozlov74

    mishakozlov74

    Joined:
    Aug 8, 2018
    Posts:
    143
    I have to mention that this error cannot be "cleared", I have to restart the editor every time it occurs.
     
  3. RippStudwell

    RippStudwell

    Joined:
    May 16, 2017
    Posts:
    3
    I also frequently experience this problem in Unity 2020.3.3f1 using Visual Studio 2019. The file that becomes locked is seemingly random and when I do a powershell search for processes locking the file- Unity is the only process shown. So probably a thread or child process that didn't properly release its' lock I'd guess.

    The only fix is to restart Unity. Happens multiple times a day. 10-15 min to re-open Unity each time. Wild.
     
  4. mishakozlov74

    mishakozlov74

    Joined:
    Aug 8, 2018
    Posts:
    143
    Yep. Do you use burst?
     
  5. runner78

    runner78

    Joined:
    Mar 14, 2015
    Posts:
    792
    I had similar problems outside of unity. This can often also be done with windows indexer lock files.
     
    mishakozlov74 likes this.
  6. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    this can be anything that checks that same file: Dropbox, antivirus, windows indexer... anything that woud check the file for changes basically.
     
    mishakozlov74 likes this.
  7. scorpioservo

    scorpioservo

    Joined:
    Jul 24, 2020
    Posts:
    13
    Getting the same issue on 2020.3.26. I suspect it might have something to do with Plastic? Since that is checking for file changes.
     
  8. Crawdad

    Crawdad

    Joined:
    Nov 23, 2016
    Posts:
    174
    I am having the same issue. Also using burst. Using 2021.2.9f1.
     
  9. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
    LeonhardP and Crawdad like this.
  10. silvergat

    silvergat

    Joined:
    Jun 11, 2020
    Posts:
    22
    Burst version 1.7.0-pre.1 solved this issue!
     
    RossRH, LeonhardP and sheredom like this.
  11. veeratheveera

    veeratheveera

    Joined:
    Feb 20, 2018
    Posts:
    2
    very simple delete the meta file of the script file
     
    KabuVG and CJ_173 like this.
  12. Maricato

    Maricato

    Joined:
    Jun 16, 2022
    Posts:
    1
    It happened to me when I deleted the file that was using the script, when I deleted the script it solved :). hope this helps
     
  13. dookosgames

    dookosgames

    Joined:
    Oct 12, 2018
    Posts:
    4
    I was having this problem. It ended up being I had saved my project files in my google drive and it was constantly backing up the files as I was changing them. I turned off my google drive syncing and it fixed the problem. Hope that helps !
     
  14. urenasalvador

    urenasalvador

    Joined:
    Oct 26, 2022
    Posts:
    1
    In my case, it was windows' one drive