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

error: Can't find a folder when doing a build

Discussion in 'Android' started by sagasantos, Oct 4, 2021.

  1. sagasantos

    sagasantos

    Joined:
    May 31, 2021
    Posts:
    3
    when I try to do a buil I get an error:

    UnauthorizedAccessException: Access to "Library / BuildPlayerData \ Editor" path is denied.
    System.IO.Directory.Delete

    I already looked for the files and there is nothing in that folder
    please help
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    A file may be locked, have you tried rebooting?
     
  3. unity_4xlKWS11Hpm7Eg

    unity_4xlKWS11Hpm7Eg

    Joined:
    Sep 5, 2021
    Posts:
    1
    I'm having the same problem, tried rebooting already and that didn't change anything
     
  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Try manually deleting that folder. Another reason, your project path might be too long if you're on Windows
     
  5. MichaelEGA

    MichaelEGA

    Joined:
    Oct 11, 2019
    Posts:
    39
    I just got this problem as well. :(

    EDIT: Deleting the 'player' and 'editor' folder fixed it!
     
    Last edited: Oct 10, 2021
  6. zebazt11

    zebazt11

    Joined:
    Nov 3, 2016
    Posts:
    1
    "Deleting the 'player' and 'editor' folder fixed it!" Thank you
     
    FeargalK, safdarzareef and Sherwinkc like this.
  7. TriRealm

    TriRealm

    Joined:
    Dec 29, 2021
    Posts:
    3
    Had this error and this appears to fix the issue, any reason as to why it happens? I was able to build before but now everytime I build I get this, so wasn't from the beginning
     
    safdarzareef and shacharoz like this.
  8. shacharoz

    shacharoz

    Joined:
    Jul 11, 2013
    Posts:
    98
    deleting these folders worked. thanks
     
    safdarzareef likes this.
  9. nicholashjdagenais

    nicholashjdagenais

    Joined:
    Sep 1, 2021
    Posts:
    2
    Where is the folders?
     
  10. ignaciomalvicino

    ignaciomalvicino

    Joined:
    Jan 9, 2022
    Posts:
    1
    it worked by deleting the whole BuildPlayerData folder (it can be found in the root of the project/library)
     
  11. Shadowbladers

    Shadowbladers

    Joined:
    Mar 23, 2022
    Posts:
    1
    simply deleting the Library folder in the repository root
    was all that was required for me to fix this build problem
     
  12. raducristiandimitrie

    raducristiandimitrie

    Joined:
    Nov 6, 2018
    Posts:
    2
    Deleting "BuildPlayerData" worked for me. Since the error was:
    UnauthorizedAccessException: Access to the path "Library/BuildPlayerData\Editor" is denied. UNITY
     
  13. unity_4309194F53CD6CD2050B

    unity_4309194F53CD6CD2050B

    Joined:
    Mar 8, 2022
    Posts:
    2
    Hi,

    I get this issue every time I try to compile webgl. It will work if I delete the library folder but my issue is, why do i have to delete the folder? I've watched countless videos and they don't have this problem. What am I doing differently? I've tried setting the permissions on the folder so that anyone can access them; and I've tried opening both Unity hub and Unity in administrator mode. Any suggestions? This is driving me mad.
     
  14. spameriknot

    spameriknot

    Joined:
    Apr 19, 2022
    Posts:
    2
    No idea if it helps troubleshoot, but I just got this error doing the Unity Junior programmer path with their "mod the cube" project, and started getting it in my other projects now. Deleting the folder in question totally helped though, so thanks to those above!
     
  15. spameriknot

    spameriknot

    Joined:
    Apr 19, 2022
    Posts:
    2
    Actually I lied. It failed too, but this time on a different folder (IL2CPP). I ended up exporting the assets as a package and starting a completely new project, importing the package, being careful to also import the webgl package before trying to publish (I messed this up on the last one, mayeb that was part of the issue?), and then publishing. This time it worked!
     
  16. GameRickster

    GameRickster

    Joined:
    Apr 28, 2018
    Posts:
    21
    for me it happened when I added this folder to Google Drive to sync.. not sure if that was the cause but it's what I did.. right now I am deleting the rebuilding the library folder, deleting playerbuilddata folder did not work for me
     
    mauriciofelippe and gterveen like this.
  17. ncho

    ncho

    Joined:
    Feb 1, 2014
    Posts:
    99
    I also started having this issue upon starting to sync the folder with Google Drive. Anyway I can sync it and not have this happen?
     
  18. selind1

    selind1

    Joined:
    Oct 7, 2020
    Posts:
    4

    @ncho You can check my solution, it worked for me. I hope it works for you too.

    Same here. I started using google drive desktop to backup my projects recently and I also started getting these same issues.
    I was just trying to built webgl and getting that error. My error title was same but it was a directory about a IL2CPP backend scripting.

    SOLUTION: here is what i did:
    1. I uninstalled google drive desktop
    2. Restarted my computer
    3. Delete the 'Library' folder under the unity project folder.
    4. Open the project again (you have to open the project again so that unity generates Library folder again)
    5. Build the project again. It builds. (problem solved)

    The reason why I deleted the whole library folder is that I realized if I delete the buildplayer folder (or any folder in your case) it it gives another error. It was just like a loop I was not finding the solution. So I thought maybe it was because of some other files in library that affects these build files and make bug. So after deleting the whole Library and opening the project again solved my issue. I will copy my solution and share in other forums as well. This problem was a total headache, I'm glad I was able to solve.
     
    Last edited: Oct 13, 2022
  19. selind1

    selind1

    Joined:
    Oct 7, 2020
    Posts:
    4
    You can delete the Library folder. No problem. It is a generated folder you can ignore it and safely delete it. Unity will generate that Library folder again when you open the project.
     
  20. Brdl42

    Brdl42

    Joined:
    Feb 4, 2020
    Posts:
    1
    Thanks for this it's working now !
     
  21. godril

    godril

    Joined:
    Oct 21, 2013
    Posts:
    4
    goddam google drive breaking stuff, I hate it
     
    Esbol likes this.
  22. Esbol

    Esbol

    Joined:
    May 22, 2016
    Posts:
    3
    ThankYouSoMuch!
     
    MichaelEGA likes this.
  23. anayurt

    anayurt

    Joined:
    Apr 2, 2017
    Posts:
    2
    Probably, you guys changed the project path (even folder names) multiple times after the initial creation or tried to launch Unity Hub as administrator.

    Just remove the available RenderPipeline from the package manager then install it. After that, reimport the project files.