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

cannot build for android on mac with android support installed by unity hub due to sdkmanager

Discussion in 'Android' started by mpattiewss, Aug 13, 2019.

  1. mpattiewss

    mpattiewss

    Joined:
    Aug 13, 2019
    Posts:
    2
    I just created a fresh project in Unity 2019.2.0f1 on a Mac. When I try to build for Android, the build fails with the following error:

    Win32Exception: ApplicationName='/Applications/Unity/Hub/Editor/2019.2.0f1/PlaybackEngines/AndroidPlayer/SDK/tools/bin/sdkmanager', CommandLine='--list', CurrentDirectory='/Users/mpattie/project_k_viewer_app/ProjectKViewer', Native error= Access denied


    Android support was installed using Unity hub. When I was installing Unity 2019 via unity hub, I checked all boxes relating to Android support and the hub says android is supported.

    It also seems a little bit odd to me that there is a win32exception on a mac, but maybe I'm confused about that.
     
  2. davemeta

    davemeta

    Joined:
    Jul 17, 2012
    Posts:
    17
    open terminal and do:

    chown -R mpattie:admin /Applications/Unity


    (instead of mpattie anyone else can use
    whoami
    command to see what their name is)

    I had the same issue this solved it for me
     
    Last edited: Aug 30, 2019
  3. tuanminhvu

    tuanminhvu

    Joined:
    Jul 18, 2019
    Posts:
    1
    Hi. It says "Operation not permitted" for me. Do you know how to fix that?
     
    Sohaib_techverx likes this.
  4. WannabeCoder

    WannabeCoder

    Joined:
    Apr 11, 2013
    Posts:
    5
    consider trying sudo chown -R mpattie:admin /Applications/Unity

    If that works then it's caused by the fact that your user does not have certain permissions. Running it as the super user (sudo) should help in that case. You will need to input the password of the account though.
     
    surits14, Sohaib_techverx and aka3eka like this.
  5. dmitry_k_playtika

    dmitry_k_playtika

    Joined:
    Jun 14, 2019
    Posts:
    2
    Thanks, that helped me !
     
  6. anisimovdev

    anisimovdev

    Joined:
    Mar 4, 2013
    Posts:
    22
    1. Copy this file. (ApplicationName=...)
    2. Delete this file.
    3. Paste this file.

    This works for me :)
     
  7. tteneder

    tteneder

    Unity Technologies

    Joined:
    Feb 22, 2011
    Posts:
    162
    My workaround was to give every user execution permission:

    Code (CSharp):
    1. sudo chmod +x <whatever ApplicationName says>
    I work with Unity on a multi-user macOS setup and I'm afraid changing the file's owner creates other issues (like breaking it for the original owner).
     
    maciejw94 and aka3eka like this.
  8. nlaourayed_unity

    nlaourayed_unity

    Joined:
    Nov 16, 2017
    Posts:
    1
    love you man <3
     
    veedub88 likes this.
  9. veedub88

    veedub88

    Joined:
    Feb 21, 2018
    Posts:
    2
    ------
    This fixed my issue. After several hours of beating my head against a wall. Thanks!
     
  10. virgilcwyile

    virgilcwyile

    Joined:
    Jan 31, 2016
    Posts:
    73
    I installed older Unity out of Hub which caused my permissions to reset somehow. But thanks to this command, it got fixed. If your Mac user name is with space then put it in quotes "Virgil Wylie" instead of mpattie . I guess any command that reset's permissions would work.
     
  11. hereoofthewild

    hereoofthewild

    Joined:
    Mar 27, 2020
    Posts:
    2

    Worked For me in 2021. using version 2019.4.1f1
     
    unitydevelopers-greg likes this.
  12. tomar8880

    tomar8880

    Joined:
    Jul 30, 2019
    Posts:
    2
    WTF.....Thanks Man
     
  13. gaggedegg

    gaggedegg

    Joined:
    Feb 4, 2018
    Posts:
    2
    Helped me! Thanks :)
     
  14. carldevelopsforcoffee

    carldevelopsforcoffee

    Joined:
    Sep 20, 2017
    Posts:
    17
    Thank You Sir Arthur :)
     
  15. wechat_os_Qy02GyFfgk8LMddSN2pho6Zow

    wechat_os_Qy02GyFfgk8LMddSN2pho6Zow

    Joined:
    Nov 4, 2021
    Posts:
    1
    Added sudo

    sudo chown -R username:admin /Applications/Unity
     
  16. PokiTheDog

    PokiTheDog

    Joined:
    Aug 17, 2018
    Posts:
    4
    Thank you, worked for me too! He's talking about the 'sdkmanager' btw (that was for me at least)
     
    ThunderOO7 likes this.
  17. bitwad_justin

    bitwad_justin

    Joined:
    Feb 2, 2017
    Posts:
    1
    Seriously, WTF. Worked for me as well. I'd love to know why that worked, but I'll take it. Thanks for the help AnisimovArthur
     
  18. itjunkii

    itjunkii

    Joined:
    Dec 1, 2011
    Posts:
    35
    God bless you
     
  19. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    Ca
    Can you please explain what is happening here? Copy what from where to where? on what?
    I see the:
    /Applications/Unity/Hub/Editor/2019.2.0f1/PlaybackEngines/AndroidPlayer/
    I see a lot of this in the Android failures when the developer has changed nothing but probably an upgrade.
    The permissions granting caught my eye.
     
  20. chetanrb26

    chetanrb26

    Joined:
    Mar 2, 2022
    Posts:
    2
    says invalid group for me.
     
  21. chetanrb26

    chetanrb26

    Joined:
    Mar 2, 2022
    Posts:
    2
    Didn't work for me :( I'm working on Ubuntu, does that make any difference?
     
  22. Vasily_Krylov

    Vasily_Krylov

    Joined:
    Oct 17, 2021
    Posts:
    1
    I am working on Fedora 35 with Appimage Unity 2020.3.30f1 and it does not work for me. I am looking for solution of this problem very long and cann't find it. Please, help
     
    Last edited: Mar 23, 2022
  23. mmomin_504

    mmomin_504

    Joined:
    May 8, 2021
    Posts:
    14
    It worked. Thanks Man..
     
  24. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,681

    Hi, the terminal file in this path, I can not see. I wanted to try your solution, but the "bin" folder does not exist.
    Any ideas??
     
  25. kodsay

    kodsay

    Joined:
    Nov 22, 2020
    Posts:
    3
    Thank you so much! Worked for me in 2020.3.5f1
     
  26. tjakobsen

    tjakobsen

    Joined:
    Sep 27, 2021
    Posts:
    2
     
  27. tjakobsen

    tjakobsen

    Joined:
    Sep 27, 2021
    Posts:
    2
    Root has access to anything, so that should not be a problem.
     
  28. tteneder

    tteneder

    Unity Technologies

    Joined:
    Feb 22, 2011
    Posts:
    162
    Can you elaborate what you mean?

    Afaik the error stems from the fact that only the user (who installed Unity) or their group has permission to execute that file. By running `chmod +x` you allow any user to execute it (without revoking the right from the installing user). So nothing is run as root, except the `chmod` command.