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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[Compilation Error] Creating directory Library/ScriptAssemblies failed.

Discussion in 'Editor & General Support' started by AFrisby, Apr 6, 2016.

  1. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    223
    Hi all,

    This is a bit of an annoyance bug, not a major issue - but once our project folder got to a particular size (guessing somewhere over the 30gb mark. It's now around 80gb -- it may have also been a upgrade somewhere between 3.5 and 4.6), this error started popping up every time a build happens (and also when building StreamedSceneAssetBundles) - clicking 'Try Again' resolves it - it always works.

    unityerror.jpg

    It generally happens twice - once prior to a build step, then immediately afterwards.

    But it's a bit of a pain since you can't wander off and grab a coffee while a build is happening since it'll inevitably show and pause the build.

    Any hints or advice on how to solve would be great, thanks.
     
    MrLucid72 likes this.
  2. sedlu

    sedlu

    Joined:
    Nov 12, 2012
    Posts:
    11
    I have the same problem, too. It also seems related to a bug that building a player from command line often fails with the following message:
    "Script compilation error: Couldn't replace Library/ScriptAssemblies/Assembly-UnityScript-firstpass.dll" .

    This makes it hard to integrate Unity into automatic build pipeline.
     
  3. MarkDolby

    MarkDolby

    Joined:
    Apr 9, 2015
    Posts:
    6
    I encountered this problem recently and I appear to have solved it by doing the following:
    • Running Unity as an admin
    • Setting the permissions on the project folder to full control for my own user account
     
  4. janan1990

    janan1990

    Joined:
    Jul 17, 2017
    Posts:
    1
    Do you have Visual Studio running?
    The files that Unity is trying to compile might be in use, possibly being open by another program like visual studio.

    Close all other programs and try again.
     
  5. tayMcKenzie

    tayMcKenzie

    Joined:
    Mar 2, 2020
    Posts:
    1
    Never had this problem before with having them both open. Closing Visual Studio helped though, thanks.
     
  6. devshafiul

    devshafiul

    Joined:
    Aug 5, 2019
    Posts:
    1
    Works for me.
     
  7. cdipalma

    cdipalma

    Joined:
    Feb 3, 2020
    Posts:
    1
    Closing Visual Studio worked for me as well.
     
  8. Ehsan-Aziz

    Ehsan-Aziz

    Joined:
    Apr 25, 2017
    Posts:
    7
    Thanks Work for me
     
  9. Deleted User

    Deleted User

    Guest

    This problem just recently appeared, right? With one of the last 2 updates of VS I started getting this error. Never was an issue keeping VS open. Hitting "Try Again" once does help too.
     
  10. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    955
    Also just started getting this.
     
  11. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    Same problem here, since I updated from 2018.4.12f1 to 2018.4.18f1

    You can delete it, grant all privileges to all users, run Unity as an administrator... no matter what, every few minutes Library folder and its content are set to read only again and I have to remove that though Explorer.
     
  12. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    116
    This definitely appears to be due to a recent VS update, closing VS fixes it but it's mighty annoying.
     
    Menion-Leah likes this.
  13. Deleted User

    Deleted User

    Guest

    Last edited by a moderator: Mar 13, 2020
    SunnySunshine likes this.
  14. Jumeuan

    Jumeuan

    Joined:
    Mar 14, 2017
    Posts:
    39
    Same here, must close Visual Studio to make Unity Build my Android Game success
     
  15. jbevain

    jbevain

    Microsoft

    Joined:
    Feb 22, 2012
    Posts:
    141
    Hi folks,

    Jb here from the Visual Studio team.

    Thanks for reporting that issue, we'll look into this. Which version of Unity and Visual Studio are you seeing this with?

    Is this happening randomly or during a specific action in Unity?

    Jb
     
  16. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    955
    I'm using Unity 2018.4.14 with Visual Studio Community 2019 Version 16.4.6. The weird thing though is that I started getting things w/o having upgraded or changed anything afaik. I upgraded to VS 16.4.6 hoping this issue would go away but it was still there.

    This issue happens when I simply press Ctrl + B in Unity with VS open.
     
  17. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    In my case, the problem started when I installed some quite recent version (I suppose just one or two versions older), but I cannot recall which one it was.
    I updated to 16.4.6, hoping for a fix, but I can confirm the issue is still there.

    It always shows up when trying to build in Unity, after a build, and when rebuilding AssetBundles.
     
  18. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    150
  19. Deleted User

    Deleted User

    Guest

    Unity 2018.4.15f1 with Visual Studio Enterprise 2019 Version 16.4.6
    VS 2017 15.9.21 does not have that problem either

    In my case it appears when Building. the popup appears once and disappears clicking either button. If VS is attached with the debugger, the dialogue reappears no matter how often you press try again.
     
  20. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    150
    Could you try to upgrade VS to 16.5.0 ?

    I made several experiments today trying to repro, and it was working properly with both Unity and VS, with VS attached or not.