Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice
  3. Improve your project's performance with our new guide on profiling in Unity.
    Dismiss Notice

SDK path is denied Unity 2018.3.5f

Discussion in 'Android' started by soft_sound, Feb 20, 2019.

  1. soft_sound

    soft_sound

    Joined:
    Aug 11, 2012
    Posts:
    30
    Hi, I've been having some trouble getting to my SDK path. I know I had this working a month ago, but I've been setting this up on another computer. I'm not sure why I'm getting this error.

    "UnauthorizedAccessException: Access to the path "C:/Program Files/Android/Android-SDK\tempToolsDir" is denied."

    "Error building Player: UnauthorizedAccessException: Access to the path "C:/Program Files/Android/Android-SDK\tempToolsDir" is denied."

    "Build completed with a result of 'Failed'"

    etc
    upload_2019-2-19_19-43-19.png

    I don't know where this tempToolsDir folder is so it must be hidden. Either way, I'm not sure how to get access to it.

    upload_2019-2-19_19-35-50.png

    I've been trying to update my SDK but I've had no success.
    upload_2019-2-19_19-38-35.png

    I'm currently running android 26 and had updated it from 25
    upload_2019-2-19_19-39-55.png

    So how do I go about solving this?

    If it makes any difference I'm using the embedded JDK.

    I noticed someone else has already posted this as a similar issue in 2019. https://forum.unity.com/threads/problem-with-creating-a-build-for-android.622957/
     
    Last edited: Feb 20, 2019
  2. soft_sound

    soft_sound

    Joined:
    Aug 11, 2012
    Posts:
    30
    Just to make sure I install everything recommended in the docs.

    upload_2019-2-19_22-52-6.png

    I installed 27
    upload_2019-2-19_22-52-32.png

    I pressed Use Highest Installed to finally get it to pick up I had an SDK


    Sadly Android SDK still fails no matter if I try to update it or Use Highest Installed.

    Considering that the manual uses 27 I figured it was safe to use.

    Access is still denied.

    I'm not sure what I'm missing.
    upload_2019-2-19_22-55-26.png
     
  3. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    13,380
    Can you try running Unity as Administrator? (Right click, Run as Administrator)
     
  4. soft_sound

    soft_sound

    Joined:
    Aug 11, 2012
    Posts:
    30
    One of my concerns with that is I run a lot of my software through Unity Hub depending on the client.

    The other issue is running with admin rights just creates a different error message this time.

    upload_2019-2-20_12-35-46.png
     
  5. soft_sound

    soft_sound

    Joined:
    Aug 11, 2012
    Posts:
    30
    Oh here is the error if it helps.


    I tried both the Update Android SDK here - got to 10% before crash.


    Code (CSharp):
    1. CommandInvokationFailure: Unable to update the SDK. Please run the SDK Manager manually to make sure you have the latest set of tools and the required platforms installed.
    2. C:/Program Files/Android/Android-SDK\tempToolsDir\bin\sdkmanager.bat --sdk_root=C:/Program Files/Android/Android-SDK tools platform-tools "build-tools;28.0.3"
    I always get much further with the Use Highest Installed before it will soft crash and I won't get any pop-up's about failures, just error messages in the console.

    upload_2019-2-20_12-44-12.png

    Wait...

    Oh it looks like only Use Highest Installed will work on admin, while Update Android SDK always fails at 10%.

    Okay cool. Looks like it's working. Thanks. Kinda extra work when using unity hub though, but as long as I have it working that's all I need.
     
  6. bjornsyse

    bjornsyse

    Joined:
    Mar 28, 2017
    Posts:
    68
    How did you launch Unity as an admin and solved this? Did you launch Unity Hub as an admin? Whenever I try to launch a unity.exe it launches the hub instead...
     
unityunity