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. Dismiss Notice

UnauthorizedAccessException during Android build

Discussion in 'Editor & General Support' started by jasonkaisersmith, Apr 25, 2022.

  1. jasonkaisersmith

    jasonkaisersmith

    Joined:
    Apr 23, 2022
    Posts:
    3
    Hi,


    I am faily new in Unity and I have a fairly simple Unity game which I am trying to build for Android but I am getting Build errors from "Bee" which are all UnauthorizedAccessException problems. Attached are the full logs, below are some extracts.

    Unity version 2021.3.1f1

    I can't find how to solve this and can't get past it!

    Building Library\Bee\artifacts\Android\Features\UnityEngine.ImageConversionModule-FeaturesChecked.txt failed with output:
    System.UnauthorizedAccessException: Access to the path 'C:\Users\Jason\Documents\Development\Unity\SnookerCalc\Library\Bee\artifacts\Android\Features\UnityEngine.ImageConversionModule-FeaturesChecked.txt' is denied.
    at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)

    Building Library\Bee\artifacts\Android\Features\UnityEngine.GridModule-FeaturesChecked.txt failed with output:
    System.UnauthorizedAccessException: Access to the path 'C:\Users\Jason\Documents\Development\Unity\SnookerCalc\Library\Bee\artifacts\Android\Features\UnityEngine.GridModule-FeaturesChecked.txt' is denied.


    Building Library\Bee\artifacts\Android\Features\UnityEngine.DSPGraphModule-FeaturesChecked.txt failed with output:
    System.UnauthorizedAccessException: Access to the path 'C:\Users\Jason\Documents\Development\Unity\SnookerCalc\Library\Bee\artifacts\Android\Features\UnityEngine.DSPGraphModule-FeaturesChecked.txt' is denied.


    Etc.
     

    Attached Files:

  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,713
    First step is to make sure your Unity installation is good.

    Start by making a fresh blank project and adding a single scene, nothing else, switch to Android and try to build it.

    Iterate on that until your Unity installation is successful and can build an empty project.

    Once that builds, if your main project still doesn't build, then bisect between the two until you find what is causing the issue.
     
  3. jasonkaisersmith

    jasonkaisersmith

    Joined:
    Apr 23, 2022
    Posts:
    3

    Thanks for responding.

    So I created a new project and just added a single UI element and tried to build for Android and I have the same error.


    But, if I switch the Unity version to 2020.3.33f1 (previously 2021.3.1f1), then both the original and the new applications build successfully!
     
  4. probitaille

    probitaille

    Joined:
    May 5, 2015
    Posts:
    34
    I got the same problem here with this version. I'm looking for a solution...
     
  5. probitaille

    probitaille

    Joined:
    May 5, 2015
    Posts:
    34
    Ok, in my case, my anti-virus was the problem and was locking the folder. Try to disable your anti-virus and build.
     
  6. standardcombo

    standardcombo

    Joined:
    Jun 28, 2012
    Posts:
    19
    I had a similar issue with 2021.3.18
    Disabling anti-virus solved it. Thank you!