Search Unity

Question Missing JDK,Android SDK tools, NDK etc

Discussion in 'Android' started by tree_arb, Feb 25, 2020.

  1. tree_arb

    tree_arb

    Joined:
    Dec 30, 2019
    Posts:
    323
    Setup a new computer today.
    Download New unity with android packages selected.

    The default External tools > Android is "you are missing xxx ... Install recommended version with unity hub"
    Is this something that just doesn't happen right with unity hub or am I just doing something stupid?

    I think I went and installed all of this manually last time outside of unity on the previous machine, and everything was then working. (NDK, android SDK)

    picture:
    https://imgur.com/a/CNDTI5s


     
  2. tree_arb

    tree_arb

    Joined:
    Dec 30, 2019
    Posts:
    323
    OK the fix was rather obvious, but I made this mistake 2 times so ill post the answer.

    When selecting modules to install with unity, or to add modules from unity hub, "Android Build Support" was checked yes, so I thought I was all set for everything inside it...but no, you have to expand that option and select the SDK,NDK,open JDK

    all set!
     
  3. Rabeh_

    Rabeh_

    Joined:
    Apr 13, 2020
    Posts:
    1
    I have a strange situation here, if i go to the Unity Hub > 2019.3.9f1 > Add Module i can see that all Android Platform are checked and installed , but the Unity Editor can't find both SDK and NDK , and by checking the path for SDK and NDK , i found them but they almost empty or incomplete, ( NDK Folder size is 19.2 KB and SDK Folder size is 18.9 MB ) . so why Unity hub says it's installed and how to fix it.
     

    Attached Files:

  4. moosesnWoop

    moosesnWoop

    Joined:
    Sep 12, 2019
    Posts:
    12
    I get the same issue. It also gives me a warning message "Unable to detect JDK in the selccted directory" .

    In my unity hub it shows that it has Android support and it has greyed out the check box. It seems the hub has not downloaded the JDK to the directory?
     
  5. Ingkilla

    Ingkilla

    Joined:
    May 1, 2020
    Posts:
    3
    Hi Guys,

    I've got same issue. I tried to download JDK from UnityHUB at least 5 times but it's not working.
    If i go to JDK folder it's empty. Anyone same issue or know how to fix it?
     
    caracol21kc likes this.
  6. emre0altan

    emre0altan

    Joined:
    Sep 12, 2018
    Posts:
    3
    +1
    I selected jdk,sdk and ndk modules, unity hub downloaded it for a time, installed it and then related folders are empty and I cant unselect the modules.
     
    Green-VR likes this.
  7. byunaylinkaya

    byunaylinkaya

    Joined:
    May 26, 2020
    Posts:
    2
    I selected add modules and select jdk, next and done. Then I opened unity hub again jdk selected but seems like not installed. Please help. unity hub 2.3.1 and unity 2019.3.14f1
     
    mansinh likes this.
  8. byunaylinkaya

    byunaylinkaya

    Joined:
    May 26, 2020
    Posts:
    2
  9. Ozcan2

    Ozcan2

    Joined:
    Nov 8, 2019
    Posts:
    3
    Does anyone find any solution ????
     
    ryoma1492 likes this.
  10. Ozcan2

    Ozcan2

    Joined:
    Nov 8, 2019
    Posts:
    3
    I am trying to download Android SDK from Visual Studio then I link it with unity
    and for JDK I download it from oracle and link it to and seem that Work good
    but now I have new error "Gradle build failed" ... and I am trying to fix it
     
    ryoma1492 likes this.
  11. ryoma1492

    ryoma1492

    Joined:
    Jul 16, 2020
    Posts:
    11
    I don't have a solution... but i am following this guys instructions, in case it helps... he said (last year) that he got it to work by ONLY installing the editor, then installing the modules through the hub one at a time...


    I didn't originally do this, since it's much more time consuming (and counterintuitive)

    i'll post back with the results

    https://forum.unity.com/threads/hel...-unity-hub.797472/?gq=unable to install unity
     
  12. ryoma1492

    ryoma1492

    Joined:
    Jul 16, 2020
    Posts:
    11
    I've read... rather directly... that by doing this, you keep yourself from being able to use the Unity Hub to manage anything after that point. I hope it works for you, but i can't get it to install via the guides in the Unity Manual i found about intalling using sdkmanager or Android Studio (the studio installed fine, but won't "play nice" with Unity

    BTW... in am Win10 OS
     
  13. ryoma1492

    ryoma1492

    Joined:
    Jul 16, 2020
    Posts:
    11
    Update: This method did NOT fix my problem.
     
    jalilseguel7 likes this.
  14. idnie

    idnie

    Joined:
    Jul 27, 2018
    Posts:
    2
    I put this solution on another post as well, as I spent two weeks trying to install the Android build support with different versions of Unity so that I could develop Oculus Quest applications. The SDK, NDK and JDK wouldn't install and I couldn't get it to work with paths in Android studio.

    I tried a lot of the online solutions that didn't work for me. I finally got it to work when I realised that the SDK, NDK and JDK were installed when I installed Unity through hubs with the Android Build Support selected, but the full Android
    module wasn't installed, so when I went to switch platforms to Android I had to install the module again. When I did this a lot of the files in the SDK, NDK folder and the JDK folder were deleted, so I lost the paths to them in external tools.

    I found that if I copied the SDK, NDK and OpenJDK folder to my desktop from the first installation, then copied them backafter I reinstalled the module it worked.

    I also just found that when I installed version 2020.1.0f1 with just the Android Build support selected, including Andriod SDK and NDK Tools and OpenJDK (no other modulues selected including Visual Studio) it installed correctly
    with the right paths to the SDK, NDK and JDK. I'm not use if it would have done this anyway if I had included other modules, but I'm sure through the two weeks of trying different things I ttried to install the 2020 version with other modules and it didn't work.

    I installed Unity versions 2019.2.10f1 and 2019.3.15f1, and deployed applications to my Oculus Quest. I am using an Asus TUF Gaming FX505DT laptop with Windows 10 Home installed.

    My path to the SDK etc is C:\Program Files\Unity\Hub\Editor\2019.3.15f1\Editor\Data\PlaybackEngines
     
  15. qa515

    qa515

    Joined:
    Aug 9, 2020
    Posts:
    1
    Finally I solved it.

    I tried reinstalling Unity and Android modules several times, but the installing behavior is weird because sometimes NDK folder is missing, and sometimes OpenJDK folder is missing, etc.

    So I installed android modules manually:

    1. Open modules.json. On Windows 10, the path is probably "C:\Program Files\Unity\Hub\Editor\2020.1.1f1\modules.json". To pretify a json file, online JSON viewer would be helpful.
    2. Search "id" keys including "android". In my environment, there are 6 keys in the bottom of the file.
    3. Download zip files specified in "downloadUrl" key.
    4. Unzip them
    5. Rename the folders from "renameFrom" to "renameTo".
    6. Copy them to "destination" folder.

    Edit: I created a small javascript.
    This script parses modules.json and shows downloadUrl, renameFrom, renameTo, and destination.

    https://htmlpreview.github.io/?http...lAndroidModulesForUnity/blob/master/util.html
     
    Last edited: Aug 11, 2020
  16. ahmedaniss

    ahmedaniss

    Joined:
    Sep 18, 2019
    Posts:
    98
    problem fixed here :
     
    bulidiriba likes this.
  17. true_warlock

    true_warlock

    Joined:
    Aug 2, 2019
    Posts:
    60
    This set of "solutions" don't work. I have all modules installed, have both visual studios and VScode (VS Code I had to manually install) but it still remains that the VCS tools (all of which are on my NEW computer with the current version of Windows) still are not found and regenerating the project, creating a new project, etc. doesn't resolve anything. Furthermore cut and copy as shown in the video example and all that is not a solution. This was not an issue back in 2018.4 but is now and Unity Techs need to stop messing with us and fix this before they claim to have another "update" of another version with the same issues and also update their webpage to reflect the current versions they have released. Otherwise they need to get off their lounge chairs and look at how 2018.4 worked and overhaul everything and just get rid of the useless mess the HUB is once and for all instead of piling on more and more and more bells and whistles that are worthless if their External Tools isn't working properly and the HUB is broken which it is. They had over a year to resolve this NONESENSE!
     
    swayams and bulidiriba like this.
  18. Helbino

    Helbino

    Joined:
    Jan 14, 2021
    Posts:
    3
    I think I have the same problem. Very surprised to see that after downloading Android Build Support the options below were not included. Will report back when it's done.

    EDIT: Yes, it's been installed! Surprised it does not all together.
     
    Last edited: Jan 14, 2021
  19. FantasticGlass

    FantasticGlass

    Joined:
    May 31, 2016
    Posts:
    38
    SUPER HELPFUL! :) Thanks a ton!
     
  20. GameDevJake08

    GameDevJake08

    Joined:
    Mar 20, 2021
    Posts:
    1

    • Screenshot 2021-04-06 193608.png
    • hey, i am getting the you are missing the recommended SDK tools. i tried to re-install unity and it worked until i closed the project. a previous post said that it was not in issue in 2018.4 so i am installing that version from the hub with iOS and Android build support. will update to say if it worked as I am making a simple Pong remake
    • using version2020.3.2f1
    • I should also probably mention that I have all other tools required(JDK, SDK, Gradle) available, juts not NDK
     
    Last edited: Apr 7, 2021
  21. JofreMP

    JofreMP

    Joined:
    Sep 20, 2019
    Posts:
    8
    Hi! I had a similar problem with my SDK/NDK and Gradle Tools, so here was my solution.

    First of all, you can see if you miss some file from your SDK. Then you can look on your antivirus if it has deleted these file and then you should say to the antivirus to ignore this one.

    If the problem persists maybe the SDK/NDK or Gradle is not correct. In order to find the correct program you should install it on your internal disk in a folder named NVPACK. You have to uninstall the previous version of your SDK before.

    https://developer.nvidia.com/codeworks-android

    This worked for me.
     
  22. WFX_GAMING

    WFX_GAMING

    Joined:
    Jun 17, 2019
    Posts:
    8
    lol each time I've try to download any version of Unity with extra modules with HUB, after about 10% of the downloading, UNITY HUB told me "something wrong....blabla" and the download crash each time ! Anybody knows the solution please ?
     
  23. van_lenh

    van_lenh

    Joined:
    Mar 13, 2021
    Posts:
    2
    i met this problem too, when ever adding new version to unity hub and open the project with that new version
     
    WFX_GAMING likes this.
  24. van_lenh

    van_lenh

    Joined:
    Mar 13, 2021
    Posts:
    2
    I have fixed the issue by reinstall unity and tick to those options in unity hub as well
    upload_2021-4-19_11-5-31.png
     
    WFX_GAMING likes this.
  25. theBachi

    theBachi

    Joined:
    Jul 23, 2017
    Posts:
    3
    Hi all,
    Had this problem for a while, directories empty, or non existent, it says it has been installed and so on.
    So in unity 2020.3.1f.1 I simply copied the paths of jdk and sdk and ndk from older unity versions that I had installed. and it worked.
     
  26. Slip_de_feu

    Slip_de_feu

    Joined:
    Jun 13, 2021
    Posts:
    8
    It works for me.

    If you are facing problems with Unity Hub about installing "Unity 2020.3.11f1 / Unity 2021.1.11f1 and android modules (SDK, NDK, OpenJDK)", here's my solution :

    1) Firstly, I would recommend to install "UnitySetup-Android-Support-for-Editor-2020.3.11f1.exe" to your Unity 2020.3.11f1's path or "UnitySetup-Android-Support-for-Editor-2021.1.11f1.exe" to your Unity 2021.1.11f1's path.
    You'll have a folder named "AndroidPlayer" in your path "{UNITY_PATH}\2020.3.11f1\Editor\Data\PlaybackEngines\" or "{UNITY_PATH}\2021.1.11f1\Editor\Data\PlaybackEngines\".

    2) In your "AndroidPlayer" folder, decompress these 3 7z files : "Android_NDK_19.0.5232133.7z", "OpenJDK_1.8.0_152.7z", "Android_SDK.7z"

    3) Run Unity 2020.3.11f1 / Unity 2021.1.11f1 and go to FILE > Build settings, click on "switch platform"

    4) You can now build your android apps in Unity 2020.3.11f1 / Unity 2021.1.11f1
     
    ashishsfb, swayams and frost4mage like this.
  27. tnaseem

    tnaseem

    Joined:
    Oct 23, 2009
    Posts:
    149
    Many thanks for this! It worked for me.

    I suddenly started having this issue when installing the new 2021.1.15f1. Uninstalling, reinstalling, rebooting, etc, etc never worked. It would always miss off the SDK, NDK and OpenJDK folders in the AndroidPlayer folder.

    Following your steps, I finally got it to work. Android builds are working fine too.
     
  28. Parabol7

    Parabol7

    Joined:
    May 2, 2021
    Posts:
    1
    This is absolute bullshit that this kind of an issue, can exist for this long and there still isn't a solid fix that works across the board. I had no issues until I tried to license my app and release to the App store and Google Play. Now I cant even get a successful build.
     
    Phenotype likes this.
  29. FishStickies94

    FishStickies94

    Joined:
    Jul 27, 2019
    Posts:
    70
    This just saved a headache cheers. Don't know why Unity haven't got a decent solution for this.
     
  30. Nanulox

    Nanulox

    Joined:
    May 2, 2014
    Posts:
    2

    2021.1.16f1 This issue still exist and this solution is godlike 100% working. Solved my issue after a day of headache
     
    hexbyte likes this.
  31. hexbyte

    hexbyte

    Joined:
    Aug 24, 2014
    Posts:
    4



    STILL HELPS IN 2021.1.17.f

    Final Step for me in 2021.1.17f - Manually use android SDK manager - to install the right version you need and point it there
    I am still having a gradle issue - but working in it.. SMH
     
    Last edited: Aug 28, 2021
  32. gioasiku16

    gioasiku16

    Joined:
    Jul 6, 2021
    Posts:
    2
    Can you show a video maybe if you can? Idk what to do actually. I will be grateful if your solutions will work in my missing ndk sdk jdk problem.
     
  33. Forcasius

    Forcasius

    Joined:
    Sep 1, 2015
    Posts:
    2
    I am also still having this problem. (Unity 2021.1.17f1 and older and newer)
    * I did what "qa515" wrote step by step
    * I deinstalled unity and the unity hub and even cleaned the registry (of what I could find) and the Local/Roaming paths of windows.
    * I installed the ndk/sdk with the sdkmanager/android studio.
    * I tired several versions of unity.
    * I tried to install the Android SDK later via the Unity Hub as suggested here earlier.
    * I even tried the beta of unity hub

    When selecting a custom NDK path in the editor it says "Unable to detect NDK in the selected directory." No matter what path I set (the one that comes with unity or the ndk that comes with android)
    When choosing the "Android NDK Installed with Unity" it only states "You are missing the recommended Android NDK. Install the recommended version using Unity Hub."

    Nothing works. The build always fails with "Android NDK not found or invalid".
    I even suspected my project to be corrupt but on my old and slow laptop the project builds
    .
    So It must be something with the local install. Some forgotten registry entry. Some forgotten file. Some incompatibility with android studio. Some not executed script.

    This is really really frustrating. Any ideas whats left to do?

    Edit 2021-09-09:
    Well, I stand corrected. It looks like my project is broken somehow. I was bold enough to update the unity version on my laptop and now it does not work either, while new projects find the ndk and can build and deploy an android application.
    I even installed unity on linux and it prompts the same error.

    My guess would be that something else breaks within the build and unity displays the wrong message... very strange.... and frustrating. Good thing its just a hobby (yet)...
     
    Last edited: Sep 9, 2021
    ashishsfb likes this.
  34. Forcasius

    Forcasius

    Joined:
    Sep 1, 2015
    Posts:
    2
    f.y.i. I "fixed" it for my case.

    tl;dr: the culprit for me was the assembly definition (asmdef) I added to a because I wanted to do some unit testing.

    Long version:
    I did what I needed to do: I created a new project, added all dependencies and copied root directory by root directory in a way that I always had a successfull build. It turned out that, as soon as I added my folder containing the i18n stuff, the android NDK was marked as not existing. As soon as I removed the asmdef file from it, the NDK was marked available again.

    I checked if the addition of asmdefs in general are a problem: no.
    When I comment my i18n stuff out, I can add the asmdef for my main project and unity is happy. I is only a problem when I add the asmdef for the i18n code (by the way: I use https://github.com/MoonGateLabs/i18n-unity-csharp). No additional warnings or errors occur.

    Unfortunately, I cannot reproduce this behaviour with a new project and just adding the i18n code to it. But nevertheless: if someone of the folks at unity reads this: please check why the behaviour is so strange. Why is the NDK marked as missing if it is clearly not. Maybe something within the NDK needs to installed additionally, but then some error message would be nice.
     
  35. NewFrequency

    NewFrequency

    Joined:
    Sep 27, 2014
    Posts:
    4
    I cant believe they dont autocheck that...
     
  36. ZoidbergForPresident

    ZoidbergForPresident

    Joined:
    Dec 15, 2015
    Posts:
    157
    The fact this is still an issue and that it was never fixed... sigh... facepalm
     
  37. karthik888

    karthik888

    Joined:
    Nov 8, 2021
    Posts:
    6
    This problem continues .............
     
  38. vovila

    vovila

    Joined:
    Nov 10, 2020
    Posts:
    1
    I solved this problem on Ubuntu 20.04 as follows:
    chmod +x Editor/Data/PlaybackEngines/AndroidPlayer/OpenJDK/jre/bin/*
    chmod +x Editor/Data/PlaybackEngines/AndroidPlayer/OpenJDK/bin/*

    and in the same way in the SDK/, NDK/ bin folders
     
    Last edited: Jan 29, 2022
    ZDAStudio likes this.
  39. karthik888

    karthik888

    Joined:
    Nov 8, 2021
    Posts:
    6
    I have tried many ways still dint solve, so I just reset my windows installed unity hub editor and done my project then the prob solved. Some times if this problem comes with sdk jdk gradle then we have to copy the path from preference and then untick or uncheck those recommended path and paste close it and run some times this might be successful
     
  40. RashadIbrahimli

    RashadIbrahimli

    Joined:
    Jan 10, 2021
    Posts:
    4
    Hi. I'm experiencing the same situation, did you find a way?
     
  41. vaibhavTrigensoft

    vaibhavTrigensoft

    Joined:
    Nov 15, 2021
    Posts:
    10
    Same issue facing on unity 2021.3.1f1
     
    pragmascript likes this.
  42. DMTSource

    DMTSource

    Joined:
    Jul 11, 2013
    Posts:
    36
    I was using the Hub and version 2021.3.4f1 (recommended) and had checked to install Android + SDK & JDK on windows 10 but this issue just seems to persis. I didn't have time to sort this silly, persistent bug out so I just reverted to a working version of Unity. I am still able to build to android and IOS using 2020.3.26f1 LTS so I hope others can have luck trying that as well.
     
  43. HexaCraft

    HexaCraft

    Joined:
    Nov 17, 2020
    Posts:
    2
    SAVED MY LIFE
     
  44. ffxiangyu

    ffxiangyu

    Joined:
    Dec 9, 2014
    Posts:
    7
    Having this problem in 2022.2.3 right now
     
  45. swayams

    swayams

    Joined:
    Sep 18, 2017
    Posts:
    24
    Cannot find any official Unity staffs answering in this very important topic.
    And yet the problem still there without fixing for many years. Just Wow.
     
  46. swayams

    swayams

    Joined:
    Sep 18, 2017
    Posts:
    24
    The path "C:\Program Files\Unity\Hub\Editor\2020.1.1f1\modules.json" is not exist anymore in UnityHub version 3.2.0. (My Unity version is 2020.3.36f1)

    Do we have another new solution for this issue ?
     
  47. quynguyenduc

    quynguyenduc

    Joined:
    Aug 16, 2022
    Posts:
    3
    I ran to this issue on 2021.3.1f. There are no folder JDK,SDK,OPENJDK after installing this version
     
  48. manugil

    manugil

    Unity Technologies

    Joined:
    Jan 13, 2020
    Posts:
    77
    Did a reinstall via the unity-hub solve the issue?
     
  49. ashishsfb

    ashishsfb

    Joined:
    May 31, 2015
    Posts:
    4

    First of all thank you Slip_de_feu for providing the download links. It worked after I used your NDK. I too had spent several weeks on just getting the android build support to work on several Unity versions.

    The most annoying thing had to be Unity Hub and its assistant software as its the Unity's entry point to get people started to a point where they can start building things, which used to be so easy back in the day e.g. pre 2019/2020. After spending weeks I think the issue is much deeper when android started changing things maybe with the coming of Kotlin and ndk. As ndk was never in picture earlier.

    What specifically happened this time with 2020.3 LTS version is -
    I tried getting the android build support on it multiple times on different computers. It just wouldn't download the SDK, NDK, OpenJDK files at all. While at the same time 2023.3 LTS worked. I tried to install all of them manually as well, searched a lot on forums - couldn't find the NDK version unity needed, not even on the android ndk unsupported older files, as if they've completely removed their access.
    Neither I was able to locate the ndk 19.0.5232133 version in the Android Studio.

    Unity Assistant is also looking for all these versions online and downloading one by one, and I guess that the failure of NDK download is somewhere causing the whole thing to fail (even jdk and sdk).