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

Build Failed

Discussion in 'Scripting' started by Absolution_Denied, Jan 12, 2022.

  1. Absolution_Denied

    Absolution_Denied

    Joined:
    Nov 26, 2016
    Posts:
    13
    Hello,

    I am working on an ML-Agents script and trying to build it but I get the following error which I do not understand at all, with some UnauthorizedAccess error and some incomprehensible characters afterward. I do not understand why it gives me all the other errors either unity_build_error.PNG since my scripts work normally (I have been following a tutorial from the ml-agents website).

    What can I do? I cannot find anything about my specific type of error
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,620
    If you search for that exception you will see it's thrown when the OperatingSystem denies I/O access. Maybe your security settings or possibly an anti-virus might be candidates.

    Likely though, you need to have Administrator access (seems you're accessing the desktop). Try making the build in one of your user folders like documents rather than the desktop as you should have full access to those.
     
  3. Absolution_Denied

    Absolution_Denied

    Joined:
    Nov 26, 2016
    Posts:
    13
    Hi, I just tried to build a new blank project for testing purposes and it did not give me a bug or anything, it built just fine. I also directed the build to go to my documents folder and it gave me the exact same error, though I am not 100% sure that this was what you suggested; You meant I should move the entire project to my documents for instance, and then try to build?
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,620
    Yes, I was suggesting the target to build to, not relocation of the project

    Maybe try creating a specific folder inside your "Documents" folder then build to that.

    I certainly wouldn't have your project in a place where Unity doesn't have Admin access to it. If you're not admin or Unity isn't started as admin then it might be the problem above. If it was located (say) in a sub-folder of "Documents" then you should be fine.

    Honestly though, I'm just guessing here.
     
  5. Absolution_Denied

    Absolution_Denied

    Joined:
    Nov 26, 2016
    Posts:
    13

    Yes, yes I did create a new test folder inside my documents folder specifically to redirect the build to, as I have already tried the first time around but it still gave me the same exact error. I even followed some instructions to run Unity hub and Unity as Admin and retry to build it in the documents file and got the same error, plus this time this "reload script assemblies" message also goes on forever and the only way to stop it is to shut down unity itself via the task manager... I am stumped
     

    Attached Files:

  6. Absolution_Denied

    Absolution_Denied

    Joined:
    Nov 26, 2016
    Posts:
    13
    So given that I did run Unity as admin, I will try to relocate my entire project to Documents just to see but happens, but I kind of doubt it will resolve the issue given some blank project in the same location did successfully build. Other than that and what I already tried I honestly don't know what else to do
     
  7. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,620
    Yes, maybe try not having your project on the Desktop as I think that's what I'm seeing from your image. Worth a test. :)
     
    Absolution_Denied likes this.
  8. Absolution_Denied

    Absolution_Denied

    Joined:
    Nov 26, 2016
    Posts:
    13
    I am shocked but moving the project itself into the documents folder actually did the trick! How could this be? I don't understand computers. I thought it did not matter since I actually explicitly took care to run Hub and Unity as Admin but apparently even that was not enough? I am asking out of curiosity
     
  9. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,620
    It'll be security privileges in your OS just not letting it happen. Running stuff from the desktop isn't optimal TBH for a bunch of apps.

    It might be related to some other security feature even if you are admin though; not sure.

    Beyond that, glad you got it working.
     
    Absolution_Denied likes this.