Search Unity

Unity Hub not installing Android SDK correctly?

Discussion in 'Unity Hub' started by cdauphinee, Aug 27, 2019.

  1. cdauphinee

    cdauphinee

    Joined:
    Sep 22, 2016
    Posts:
    3
    I just did a clean install of 2019.2.2f1 via Unity Hub, including the Android Build Support module (SDK + NDK and OpenJDK).

    When I open my project and try to build for Android, I get an 'Unable to locate Android SDK.' error. Looking in the logs, it seems like it has no problem finding the JDK, however.

    I tried uninstalling and re-installing the editor alone, then adding the Android modules separately, but I received the same error when I try to build.

    If I look in Preferences -> External Tools 'Android SDK Tools Installed with Unity' is checked and it does seem to recognize the SDK. If I uncheck this and try to manually point it to %PROGRAMFILES%\Unity\Hub\Editor\2019.2.2f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK, I get 'Unable to detect SDK in the selected directory.'

    Am I missing something? Are there additional steps needed to install the Android SDK via Unity Hub?
     
    DEBBAJfarouk and rsodre like this.
  2. safaGH

    safaGH

    Unity Technologies

    Joined:
    Mar 12, 2019
    Posts:
    224
    Hello @cdauphinee, if you are on Linux, it's a known issue that will be fixed soon, in the meanwhile try installing the SDK tools manually for your editor. If not, it seems like a bug, please report it with the hub bug reporter. Thank you for your feedback.
     
  3. eethaen

    eethaen

    Joined:
    Jul 14, 2018
    Posts:
    2
    @safaGH I'm on 2019.2.4f1 (Windows) and the issue is still available
     
  4. anuroopsingh945

    anuroopsingh945

    Joined:
    Oct 4, 2018
    Posts:
    1
    @safaGH I'm on 2019.3.0f3 (Linux) and the issue is still available
     
    akashkinha likes this.
  5. Mikilo

    Mikilo

    Joined:
    Jan 29, 2013
    Posts:
    659
    2019.3.0f6, Windows, issue still occurring.
     
  6. SharpCoder

    SharpCoder

    Joined:
    Apr 10, 2016
    Posts:
    2
    2019.3.0f6, same problem
     
  7. Snitem

    Snitem

    Joined:
    May 18, 2016
    Posts:
    4
    I got it to work. However it was a bit of a hassle so I recorded a video.
     
    Last edited: Feb 15, 2020
    BonusB and safaGH like this.
  8. salvadoragati

    salvadoragati

    Joined:
    Mar 6, 2020
    Posts:
    1
    2019.3.0f6, same problem
     
  9. safaGH

    safaGH

    Unity Technologies

    Joined:
    Mar 12, 2019
    Posts:
    224
    True, the hub was installing SDK and NDK android build support modules in the wrong destination. With the new version of the hub, this should be fixed. On which OS are you @salvadoragati ?
     
    Snitem likes this.
  10. Tarrag

    Tarrag

    Joined:
    Nov 7, 2016
    Posts:
    215
    same problem 2019.3.0 and 2019.3.1f1. Using latest Unity Hub. Installed fresh 2019.3.1 hoping to get the files from there for 2019.3.0. Im on win10
    @safaGH For these events, it'd be helpful you publish the relevant recommended versions to use so we can download/install them ourselves, otherwise it's quite a guess work
    I have tried setting path for JDK with packages jdk 1.8.0_172,_181,_192,_241 and all give red warning not installed with unity and use the hub or provide custom location :(
     
    Last edited: Mar 13, 2020
  11. Markus_T

    Markus_T

    Joined:
    Jan 23, 2014
    Posts:
    8
    I was having trouble figuring out how to load the SDKs from the Hub as Unity said I should. Then I realized that in the Add Modules section, next to Android Build Support it wasn't good enough to just check that box. You have to actually expand that section with the little arrow and then manually also check the two boxes to install the Android tools!
    Once I did that, I was able to build with no problem.

    Maybe this is obvious to everybody else, but it escaped me for a while and was frustrating.

    Unity-Android-SDK.gif
     
  12. jakebmabey

    jakebmabey

    Joined:
    Mar 23, 2020
    Posts:
    3
    TokyoWarfareProject likes this.
  13. unity_TCXESn5WnceY9g

    unity_TCXESn5WnceY9g

    Joined:
    Mar 27, 2020
    Posts:
    1
    Hi guys, the same issue persists with me on MAC. The problem is I am almost completely new to Unity and this is such a huge head-ache. I tried installing them seperately and through the HUB. :( I am really frustrated as this has been impending progress for 3 days now.
    It seems to be able to locate JDK but can't find NDK and SDK and I can't open them manually through External Tools as it says INVALID ANDROID DIRECTORY - unable to find ndk in directory. Same goes for SDK. Please advice!
     
    himanshuaneja99 likes this.
  14. rabbitlbj

    rabbitlbj

    Joined:
    Sep 25, 2015
    Posts:
    1
    Still occuring on Hub 2.3.0 and Unity2019.3.4f1
    I found this installment(include SDK+NDK and OpenJDK) will be OK when I installing Unity
    BUT after that, I still can not build Android in Build Settings dialog, it show a download button, after downloading UnitySetup-Android-Support-for-Editor-2019.3.4f1.exe this file, but this installment will remove and delete all files in Unity\2019.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer folder and install itself files, so I think this is a mistake loop forerver, you install sdk but no support for editor, you install support for editor but no sdk
     
    davespser likes this.
  15. RedTreeIce

    RedTreeIce

    Joined:
    Apr 2, 2020
    Posts:
    1
    God bless you man!!
     
  16. JDBerart

    JDBerart

    Joined:
    Apr 20, 2020
    Posts:
    1
    You made my day!! thank you!
     
  17. xi003

    xi003

    Joined:
    Oct 20, 2017
    Posts:
    1
    I am encountering the same problem and I am using: Unity Hub 2.3.0 and Unity 2019.2.13f1
     
    cadkins83 likes this.
  18. codemonkk

    codemonkk

    Joined:
    Jun 19, 2018
    Posts:
    1
    I have unity hub version 2.3.1 and it's still showing corrupt download files. Also I tried downloading unity without hub but SDK and ndk gets missing. Even after adding them in the unity folder, it is not working. Any help
     
  19. naveen90

    naveen90

    Joined:
    Apr 15, 2013
    Posts:
    3
    @codemonkk
    I am also facing same issue from last three days. tried many things to get rid of this.
    But still no luck.

    Can anybody from Unity Team look into this issue.

    Steps to reproduce issue:-
    1)Working on window 8.1.
    2)Installed Unity Hub 2.3.1
    3)Added module Android platform with android sdkn ndk checked , visual stdio
    4)It is unable to find android sdk in unity preference(error message:you are not using recommanded version of android sdk)
     
  20. Lee_J_Soar

    Lee_J_Soar

    Joined:
    May 18, 2020
    Posts:
    1
    First day back on unity in 8 years. I came to this problem.

    Managed to figure it out and fixed it.

    If anyone needs info on how let me know, as it was quite simple in the end.
     
    semir_Ging likes this.
  21. Muskie

    Muskie

    Joined:
    Jan 21, 2017
    Posts:
    98
    Or, instead of teasing us with the solution, just write the solution?
     
    XlianneX, KwahuNashoba and EpicWolffe like this.
  22. Vinny-Ngan

    Vinny-Ngan

    Joined:
    Jul 29, 2013
    Posts:
    8
    What is it ? a secret need IAP ? :D
     
  23. safaGH

    safaGH

    Unity Technologies

    Joined:
    Mar 12, 2019
    Posts:
    224
    Hello guys ! We are sorry for the inconvenience you are experiencing. So if I understood well the issue, even when you install the android build support (with ndk,sdk and jdk selected) via the hub for a specific editor, the editor is not detecting it as a recommended version? We had this issue before but we thought it was fixed ! So let's investigate together :) Can you check where those modules were installed (Go installs tab in the hub >> three dots >> Reveal in Finder >> PlaybackEngines >> AndroidPlayer). If you find the content directly in folders named SDK or NDK, it should work. If you find another folder wrapping the content of the module inside those folders named SDK or NDK, it's a problem :/ Can you also guys give us the editors with which you are experiencing these issues ? Thank you !
     

    Attached Files:

  24. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    360
    I have tried installing the latest (2019.3.14f1) and an older version (2019.3.7f1) of Unity and am being told I am missing Android SDK and JDK in the former and JDK in the latter


    . I have checked the boxes in the install modules section but they don't install. After install has finished they continue to show the amount of space they need rather than "installed" - any ideas?
    jdk install.png
    thanks
     
    kirillozhoga likes this.
  25. safaGH

    safaGH

    Unity Technologies

    Joined:
    Mar 12, 2019
    Posts:
    224
    Your OpenJDK installation must have failed for some reason, please report a bug for the support team to look into your logs.
     
  26. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    360
    can you supply more info on how to do this
    thanks
     
  27. clamum

    clamum

    Joined:
    May 14, 2017
    Posts:
    55
    Unity says I need to install JDK and NDK via UnityHub but I didn't see where that was possible until you mentioned it here. Thanks man!
     
  28. manildayma

    manildayma

    Joined:
    Mar 17, 2019
    Posts:
    4
    i did download the checked these boxes, still I'm getting SDK MISSING error. In the middle of nowhere, I got this error. Prior to this, it was working fine.
     
  29. DcDeath

    DcDeath

    Joined:
    Apr 15, 2013
    Posts:
    12
    Same here.. Unity Hub 2.3.2 is broken, fails to open - when it does open it looks like it works but when you try to install unity it crashes and runs in the background. If you do get an installer running you can't remove the broken links to the Android SDK. Everything was working but now can cant export anything for android on any installer.
     
  30. SirJos

    SirJos

    Joined:
    Jul 3, 2020
    Posts:
    1
    unity hub keep doing it to me too, I'm on Unity 2019.4.1f1. Is there a way to manually install it in the right destination?
     
  31. rsbaker256

    rsbaker256

    Joined:
    Oct 25, 2019
    Posts:
    2
    On Catalina 10.15.5

    Clean install of 2019.4.2f1 using hub 2.3.2 having clicked android as a platform and including the android sdk and java in the check boxes below.
    I added a cube to the middle of the SampleScene, played the game and everything worked as expected.
    In build settings, I set the platform to android and added the SampleScene.

    The build returned the following error:
    Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:197)
    > Could not create service of type FileHasher using BuildSessionScopeServices.createFileSnapshotter().

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:197)

    I made this as "out of the box" and "vanilla" as I could, but the android build does not work.

    Any ideas?
     
  32. ChopSui

    ChopSui

    Joined:
    Dec 20, 2016
    Posts:
    8
    Has this been fixed yet? What's the status? I
     
  33. Fox_GAMING

    Fox_GAMING

    Joined:
    May 7, 2018
    Posts:
    12
    I'm having this problem too. Unity Hub 2.3.2. Clicking the 3 dots doesn't show Install Modules, I just spent probably around half an hour installing Unity 2019.4.4f1, and chose Android SDK, and it doesn't look like it is installed.

    Ok, I went to \Unity\Editor\Data\PlaybackEngines\AndroidPlayer, i was able to find it, and it has files in it. But it's still not regestering it in Unity. I even downloaded the Command Line SDK from Android Studio, selected the folder with sdkmanager in it, and it still wouldn't work, it would say;"Unable to detect SDK in the selected directory", and then gives 2 paths, slightly different, and says Neither [PATH 1] nor [PATH 2] exists.
     
    Last edited: Jul 22, 2020
  34. NOWAITDONT1

    NOWAITDONT1

    Joined:
    Jul 14, 2020
    Posts:
    1
    I fixed this by going to into the Unity\Editor\Data\PlaybackEngines\AndroidPlayer and deleting the openJDK file, then adding the module again.
     
  35. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    362
    Yes, I confirm that is what I did to fix the issue when installing unity for the first time on a new computer that never saw unity before then. Now it appears is working fine when adding new versions.
     
  36. Enumerator_T

    Enumerator_T

    Joined:
    Nov 5, 2014
    Posts:
    16
    I already have all the ABS/A/SDK&NDK/OJDK yet...
     
  37. senkal_

    senkal_

    Joined:
    May 22, 2018
    Posts:
    82
    @Enumerator_T
    About your error messages.
    When you click one of them, for example: "Command InvokationFailure: failed to update Android SDK package list" you should be able to see whole command/message with maybe more detailed error.
    Maybe something about missing permissions or network problem etc.
    Do you see anything useful when you click that message?
     
  38. Enumerator_T

    Enumerator_T

    Joined:
    Nov 5, 2014
    Posts:
    16
    I found out what the problem was, untick the SDK and add a / at the end and then build.
     
    senkal_ likes this.
  39. Enumerator_T

    Enumerator_T

    Joined:
    Nov 5, 2014
    Posts:
    16
    PS sometimes it requires you to remove the forward slash, i think this is build based, and they literally ignore file structure of the installed SDK and don't know how to enumerate it to validate it as an SDK automatically, C'mon unity, You're meant to be on the top of the ball these days with all these builds you're pushing, still pushing bugs!
     
  40. unity_8t7NjqfkzBF5Xw

    unity_8t7NjqfkzBF5Xw

    Joined:
    Jul 29, 2020
    Posts:
    1
    Hola el problema lo resolví copiando los archivos de una versión anterior de unity en mi caso 2019.4.2f PlaybackEngines\AndroidPlayer\ , pegando los archivos de SDK y NDK.

    Después de revisar me di cuenta que en la carpeta NDK no existe nada y en la SDK faltan archivos.
     
  41. Stamblew

    Stamblew

    Joined:
    Sep 3, 2014
    Posts:
    22
    This error is so annoying, I am still facing it in Unity 2019.3.13 in Windows when building for Android, please Unity fix this!
     
  42. MaximPP

    MaximPP

    Joined:
    Jan 26, 2019
    Posts:
    39
    Unity 2019.4.8
    When I start the editor I get an error "To use the “java” command-line tool you need to install a JDK.".
    The OpenJDK module is installed in Unity HUB.
     
  43. akashjohny02

    akashjohny02

    Joined:
    Mar 30, 2020
    Posts:
    6
    unity hub 2.3.2 is becoming a complete waste these days..
    i used it on windows 10. tried to install 2019.4.9lts version using unity hub,
    installation was too slow. like a cmd window apeared for almost 2 hours. lastly i quit. and checked with unity and my 2019 file was working .. but at build process i got the same error "you are missing the recommended android sdk tools. install using unity hub unity". i haved check all the sdk and ndk at time of adding modules.... so whats the problem....
     
  44. JayvanGeld

    JayvanGeld

    Joined:
    Sep 11, 2020
    Posts:
    1
    I have unity 2020.1.3f1 installed, which is where I also installed the android SDK and JDK. For some reason unity hub made my project use unity 2019.2.6f1, for which I don't have these packages installed. Changing the project to use the correct unity version worked for me.
     
  45. JxWolfe

    JxWolfe

    Joined:
    Jan 10, 2017
    Posts:
    2
    using Unity 2020.1.6f1 - Hub 2.4.0 - Linux (Mint).
    have installed all android related packages via the hub. No error messages, however in the build menu "No Android module loaded." Heading over to (unity install folder)/2020.1.6f/Editor/Data/PlaybackEngines/AndroidPlayer/ results in NDK, OpenJDK, and SDK folders filled. That's it. I've seen screenshots where people have Data, Source, Tools, modules.asset files and folders, but none of those are on this device.
    (unity install folder)/2020.1.6f/Editor/Data/BuildTargetTools/AndroidPlayer/ is an empty folder - but I don't know if it's used.
    Now that manually installing & assigning Android APK and such has been removed - please fix this. (Still doesn't work on 2020.2.0b2)
    If anybody from unity is reading this: thanks for dark mode on personal now!
     

    Attached Files:

    Gangan_K likes this.
  46. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    133
    Unable to find the Android SDK manager tool. Required Android packages (extra-google-m2repository, extra-android-m2repository) can not be installed. Android SDK path not set. Set the Android SDK property using the Unity "Edit > Preferences > External Tools" menu option on Windows or the "Unity > Preferences > External Tools" menu option on OSX. Alternatively, set the ANDROID_HOME environment variable
    UnityEngine.Debug:LogError(Object)
    GooglePlayServices.ResolverVer1_1:DoResolution(PlayServicesSupport, String, OverwriteConfirmation, Action)
    GooglePlayServices.PlayServicesResolver:Resolve(Action)
    GooglePlayServices.PlayServicesResolver:AutoResolve()
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

    I'm getting this in the following LTS versions: 2017, 2018, 2019. At Unity startup and after apk build which is successful. I can't remove it, even with older tools or new 26.1.1.
     

    Attached Files:

  47. XRA

    XRA

    Joined:
    Aug 26, 2010
    Posts:
    253
    issues is still occurring btw,
    I installed 2020.2.0b6 with all the android boxes ticked in hub and it is failing when making an android build, saying sdk level is 0 and it needs 26.
    Checking editor preferences the external paths look correct and all the usual android player files and folders are as expected in C:\Program Files\Unity\Hub\Editor\2020.2.0b6\Editor\Data\PlaybackEngines\AndroidPlayer\
     
  48. LUK3ARK

    LUK3ARK

    Joined:
    Nov 2, 2020
    Posts:
    2
    still occurring please someone help :( stuck on this for 2 days
     
  49. marquizzo

    marquizzo

    Joined:
    Aug 9, 2018
    Posts:
    1
    @safaGH Is anybody reading this thread? A lot of people are running into this issue and we still have no resolution or even instructions on how to fix it from the dev team.

    I'm using Unity Hub 2.4.2 and it says "Android Build Support" is installed.

    ABuildSupport.png

    But when you look at the folders, 2018.4 DOES NOT install the SDK or NDK or OpenJDK folders:

    2018vs2020.png
     
  50. BonusB

    BonusB

    Joined:
    Jun 9, 2020
    Posts:
    3
    Will this work for windows?
     
unityunity