Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug You are missing the recommended JDK. Install the recommended version using the Unity Hub.

Discussion in 'Android' started by JasperCiti, Aug 2, 2021.

  1. JasperCiti

    JasperCiti

    Joined:
    Jul 5, 2013
    Posts:
    17
    upload_2021-8-2_18-25-25.png

    upload_2021-8-2_18-26-0.png

    upload_2021-8-2_18-28-9.png

    As seen in the screenshots above, Unity does not work out of the box. Please fix Unity or the Hub or advise what the recommended way is to install Unity for an Android setup.
     
  2. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    Hi, probably something failed during the installation. The "OpenJDK" directory in your screenshot is missing "include" and "bin" directories. Please try to reinstall it.
     
  3. JasperCiti

    JasperCiti

    Joined:
    Jul 5, 2013
    Posts:
    17
    I have uninstalled Unity and reinstalled it. Some files remained so I deleted those files manually. Then I reinstall Unity again. This time it didn't even create the OpenJDK directory although no errors was reported.
     
  4. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    Could you check the Hub logs, maybe something will be mentioned there? You can find them here:
    • Windows: `%UserProfile%\AppData\Roaming\UnityHub\logs`
    • Mac: `~/Library/Application support/UnityHub/logs`
    • Linux: `~/.config/UnityHub/logs`
     
  5. JasperCiti

    JasperCiti

    Joined:
    Jul 5, 2013
    Posts:
    17
    I did a third reinstallation and this time I got this in the error logs:

    Code (CSharp):
    1. {"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[\n  'Creating the folder of android-ndk, if needed: C:\\\\Program Files\\\\Unity\\\\Hub\\\\Editor\\\\2021.1.16f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK'\n]","timestamp":"2021-08-03T15:04:30.795Z"}
    2. {"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'execInstaller' ]","timestamp":"2021-08-03T15:04:30.796Z"}
    3. {"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'installFromExe' ]","timestamp":"2021-08-03T15:04:30.797Z"}
    4. {"moduleName":"UnityInstallStepsWindows","level":"info","message":"[\n  'install C:\\\\Users\\\\Caspar\\\\AppData\\\\Local\\\\Temp\\\\unityhub-6fdd31d0-f46a-11eb-b05a-65e25b99798c\\\\UnitySetup-Android-Support-for-Editor-2021.1.16f1.exe /S /D=C:\\\\Program Files\\\\Unity\\\\Hub\\\\Editor\\\\2021.1.16f1'\n]","timestamp":"2021-08-03T15:04:30.797Z"}
    5. {"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'execInstaller' ]","timestamp":"2021-08-03T15:04:30.803Z"}
    6. {"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'installFromZip' ]","timestamp":"2021-08-03T15:04:30.804Z"}
    7. {"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'execInstaller' ]","timestamp":"2021-08-03T15:04:30.804Z"}
    8. {"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'installFromZip' ]","timestamp":"2021-08-03T15:04:30.804Z"}
    9. {"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'execInstaller' ]","timestamp":"2021-08-03T15:04:30.805Z"}
    10. {"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'installFromZip' ]","timestamp":"2021-08-03T15:04:30.805Z"}
    11. {"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'execInstaller' ]","timestamp":"2021-08-03T15:04:30.805Z"}
    12. {"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'installFromZip' ]","timestamp":"2021-08-03T15:04:30.805Z"}
    13. {"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'execInstaller' ]","timestamp":"2021-08-03T15:04:30.805Z"}
    14. {"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'installFromZip' ]","timestamp":"2021-08-03T15:04:30.805Z"}
    15. {"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'execInstaller' ]","timestamp":"2021-08-03T15:04:30.806Z"}
    16. {"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'installFromZip' ]","timestamp":"2021-08-03T15:04:30.806Z"}
    17. {"level":"error","message":"Unhandled promise rejection, reason: ENOENT: no such file or directory, open 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.1.16f1\\Editor\\Data\\PlaybackEngines\\AndroidPlayer\\SDK\\tools\\lib\\monitor-x86\\plugins\\org.eclipse.equinox.simpleconfigurator_1.0.301.v20120914-163612.jar'\n\tstack Error: ENOENT: no such file or directory, open 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.1.16f1\\Editor\\Data\\PlaybackEngines\\AndroidPlayer\\SDK\\tools\\lib\\monitor-x86\\plugins\\org.eclipse.equinox.simpleconfigurator_1.0.301.v20120914-163612.jar'","timestamp":"2021-08-03T15:04:32.578Z"}
    18. {"moduleName":"UnityInstallStepsWindows","level":"info","message":"[ 'unzip finished' ]","timestamp":"2021-08-03T15:04:33.484Z"}
    and

    upload_2021-8-3_17-9-58.png

    (There is no Unity running. I checked Task Manager too. Also I had made sure the directory was empty before I reinstalled. I also restarted the Hub before I started the new installation (just in case).
     
  6. JasperCiti

    JasperCiti

    Joined:
    Jul 5, 2013
    Posts:
    17
    And I also see this error several times in the logs:

    Code (CSharp):
    1. {"moduleName":"Installation Manager","level":"error","message":"[\n  'Parent editor location not found in the available editors list. Falling back to default location.'\n]","timestamp":"2021-08-03T14:59:55.266Z"}
     
  7. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    I will inform the Hub team about this.
    Meanwhile, could you try to install Unity in a shorter path? Looking at the log, I think the problem could've occurred because "C:\\Program Files\\Unity\\Hub\\Editor\\2021.1.16f1\\Editor\\Data\\PlaybackEngines\\AndroidPlayer\\SDK\\tools\\lib\\monitor-x86\\plugins\\org.eclipse.equinox.simpleconfigurator_1.0.301.v20120914-163612.jar" is a longer path than what Windows can handle by default. Could you try to install the editor directly at "C:\\" instead of "C:\\Program Files\Unity\Hub\Editor"?
     
  8. JasperCiti

    JasperCiti

    Joined:
    Jul 5, 2013
    Posts:
    17
    Yet, that is the default path. I didn't change the path. How did the testers test Unity on Windows if the default path is too long?
     
  9. BrBarry

    BrBarry

    Joined:
    Jul 16, 2019
    Posts:
    10
    Ok, I have a simple workaround to correct the missing content in any editor version.

    1. Got to your editor version. e.g. C:\Program Files\Unity\Hub\Editor\2020.3.16f1
    2. Open the modules.json file. (I used notepad, but ensure it is not to default).
    3. Scroll to the bottom and will find the downloadURL associated with openJDK.
    4. Copy the whole link to your web browser and download the zip file.
    5. Extract the zip file and copy the content into the openJDK folder (you may need admin permission to complete this)
    This should work... however, I now get Gradle Build Failed error. So I'm hoping someone has a workaround for that one.

    Edit... After further research, I have found that if you update the Gradle it will download the requited update file set to your project text time you restart. However, since being in a school network, this was the catalyst for this error and failure. So I hotspoted my phone and tried again and ALL works fine.
    Just need to get IT to add the external link to my allow list/
     
    Last edited: Aug 16, 2021
  10. DemonFangZ

    DemonFangZ

    Joined:
    Feb 6, 2019
    Posts:
    8
    I encountered the same issue yesterday. I thought it had something to do with switching to the Unity Hub beta release channel, so I switched back to the production channel. Then uninstalled and reinstalled Unity 2020.3.16f1

    Seems to work fine now.
     
  11. Aurigan

    Aurigan

    Joined:
    Jun 30, 2013
    Posts:
    291
    Same issue and solution - seems like the nice dark mode hub just doesn't install the JDK etc. properly and there's no way to then fix it. @JuliusM
     
  12. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    Yes, this is a high priority issue for the Hub beta. The hub team is working on a fix.
     
    trooper likes this.
  13. trooper

    trooper

    Joined:
    Aug 21, 2009
    Posts:
    748
    Can we just get these additional sdk's added to the non unity hub installer so when it breaks we at least have the ability to manually install?
     
  14. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    Unfortunately we can't do that due to licensing.
     
  15. OMGeeky

    OMGeeky

    Joined:
    Sep 5, 2018
    Posts:
    17
    had the same Problem too but also for SDK and NDK. The Fix by manually downloading seems to help there too, even if its a bit more that you have to do because it renames the folders or moves them to a subfolder etc. but its all in the modules.json file where the stuff has to go.
     
  16. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    I remember solving this by manually wiping the androidplayer folder and then adding back the Android Support module from the HUB.

    Yet, I'm back here because I recently installed an older Unity version and the new one stopped working.

    So I'm looking around again, reddit and forums, hoping it's going to get addressed at some point.

    It's not just affecting mobile (phones) but also android (quest 2) development. So here's my +1 for this (I already added it to the bug report).

    Sidenote: the "losing license activation issue" keeps happening. Beta or not beta. Fresh install or not.
     
    OMGeeky likes this.
  17. sergiodl_res

    sergiodl_res

    Joined:
    Aug 17, 2021
    Posts:
    1
    I had this issue on Linux. Also, searching for connected Android devices in File > "Build Settings..." wouldn't work either.
    Fixed it adding execution permission ("chmod u+x file1 file2 file3 ...") to all binaries in

    2020.3.25f1/Editor/DataPlaybackEngines/AndroidPlayer/SDK/platform-tools/
    2020.3.25f1/Editor/DataPlaybackEngines/AndroidPlayer/OpenJDK/bin/
    2020.3.25f1/Editor/DataPlaybackEngines/AndroidPlayer/OpenJDK/jre/bin/

    There might be a lot more of binaries that need the execution bit. I am not sure why unityhub is not applying the correct permissions to the binaries.
     
    andnacho likes this.
  18. christianinioann

    christianinioann

    Joined:
    Jan 28, 2022
    Posts:
    1


    This is the best solution!
    Thanks!
    I have Mac OS.
    There was no OpenJDK folder at all.
    Created a folder. I did as you wrote. And everything works!
    Thanks!
     
  19. AshyB

    AshyB

    Joined:
    Aug 9, 2012
    Posts:
    191
    This worked for me Linux mint 20.3 Unity Hub 3.0.1 Unity 2020.3.30f1
     
  20. mvbaalen

    mvbaalen

    Joined:
    Mar 29, 2022
    Posts:
    1
    I had the same issue, with Unityhub 3.1.1 / Unity 2020.3.32f1 on Ubuntu 20.04 LTS.
    After setting the execute permissions to the binaries in the 3 folders mentioned in #17 the error about the OpenJDK was fixed, but I was unable to build and run on Android device because of an error.
    After setting execute permissions to the following folder, it worked:

    2020.3.25f1/Editor/DataPlaybackEngines/AndroidPlayer/SDK/tools/bin/

    So in my case I had to set execute permission to the binaries in these 4 folders:

    2020.3.25f1/Editor/DataPlaybackEngines/AndroidPlayer/SDK/tools/bin/
    2020.3.25f1/Editor/DataPlaybackEngines/AndroidPlayer/SDK/platform-tools/
    2020.3.25f1/Editor/DataPlaybackEngines/AndroidPlayer/OpenJDK/bin/
    2020.3.25f1/Editor/DataPlaybackEngines/AndroidPlayer/OpenJDK/jre/bin/

    Hope this helps other people.
     
    TDolphin and NiQiuNiQiu like this.
  21. Athomield3D

    Athomield3D

    Joined:
    Aug 29, 2012
    Posts:
    193
    Same problem still happening in June 2022 using Windows 10
     
  22. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    The issue that was discussed before is fixed. If you are still experience a problem, you are likely running into a new issue. Please report a bug, since we are currently not aware of such issue.
     
    CrandellWS likes this.
  23. Athomield3D

    Athomield3D

    Joined:
    Aug 29, 2012
    Posts:
    193
    Using the latest beta channels fails to install OpenJDK and sdkmanager I believe, switching back to the production channel fixed it. Will report a bug when I get the time.
     
  24. LOLinc

    LOLinc

    Joined:
    Nov 18, 2013
    Posts:
    28
    It does sound a lot like it wasn't fixed all around - or you have regression.
    Either way, I am using Unity Hub 3.2.0 (stable channel) and I am experiencing this error with unity 2022.1.8f. The Android (JDK) modules do not seem to be installed correctly and throw errors when trying to build an empty project. Tried uninstalling and reinstalling the editor+modules with the same result.
    I'm running Ubuntu 20.04.4 LTS.
     
  25. narwhaltruth

    narwhaltruth

    Joined:
    Feb 2, 2022
    Posts:
    1
    Also can't solve this issue. I'm on Mac silicon, on Unity Hub 3.2.0, separately tried using both recommended (Unity 2021.3.6f1 silicon) and prerelease (2022.2.0b2 silicon). I have tried all the solutions in this thread and none have worked:
    * deleted all Unity installs and tried to install from scratch, default directories
    * redownloaded the OpenJDK using the url from the manifest.json and moved it into AndroidPlayer folder
    * tried wiping AndroidPlayer and reinstalling
    * chmod u+x every binary in AndroidPlayer

    The OpenJDK is there, the files are all there. /include, /jre, /bin, etc. They are all chmod'ed +x. But Unity continues to tell me that i'm missing the recommended JDK.

    upload_2022-7-22_12-22-26.png
     
    kolobokspb likes this.
  26. CrandellWS

    CrandellWS

    Joined:
    Oct 31, 2015
    Posts:
    178
    On my Linux system after I set the executable bit and the app built. After choosing `File->Exit` and then reopening the project the warning went away.
     
  27. kolobokspb

    kolobokspb

    Joined:
    Nov 21, 2016
    Posts:
    16
    I have a problem too.
    None of the tips above helped solve the problem.
    Unity Hub 3.2.0 and Unity 2022.2.0b6

    https://prnt.sc/1APn7f8qV2xb
     
    Last edited: Aug 31, 2022
  28. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Do those paths exist on your disk ?
     
  29. kolobokspb

    kolobokspb

    Joined:
    Nov 21, 2016
    Posts:
    16
    Yes. (operation system win 10)

    1. Modules for unity (unity Unity Hub 3.2.0)
    upload_2022-8-31_23-27-41.png

    2. Components on disk:
    upload_2022-8-31_23-24-1.png

    3. NDK on disk:
    upload_2022-8-31_23-24-46.png

    4. OpenJDK on disk:
    upload_2022-8-31_23-25-22.png

    5. SDK on disk:
    upload_2022-8-31_23-22-19.png
     
  30. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
  31. kolobokspb

    kolobokspb

    Joined:
    Nov 21, 2016
    Posts:
    16
    6. Tools
    upload_2022-8-31_23-30-32.png

    upload_2022-8-31_23-33-17.png

    There were no errors or warnings during installation!
     

    Attached Files:

  32. iori4497

    iori4497

    Joined:
    May 7, 2018
    Posts:
    1
    It's actually a permission problem.
    Set 'Execute' to at least 'Only owner' for all exe/script-like files in warned directories.
     
  33. sxmad

    sxmad

    Joined:
    Nov 4, 2014
    Posts:
    6
    I have the same issue with 2022.2.2f1c1. then replace "SDK", "OpenJDK", "NDK" 2022.2.2f1c1 from 2022.2.0b16 to, and resolved.

    upload_2023-1-19_15-10-35.png
     
  34. sapoznikovdaniel

    sapoznikovdaniel

    Joined:
    Aug 15, 2021
    Posts:
    1
    I was able to fix everything. I removed the Openjdk folder from the current version and copied from the previous version of the editor. try it might work
     
  35. MVRKHQ

    MVRKHQ

    Joined:
    Jul 18, 2017
    Posts:
    7
    Just dealt with this issue. My actual
    modules.json
    file had the wrong versions of all the modules that it was pulling from. I had to get my coworker's modules file. Then when downloading from the URL in the modules file, I was unable to extract certain files due to an unknown error. I ultimately had to ask my coworker to zip up their OpenJDK and NDK folders and give them to me for it to work...
     
  36. daviddf1

    daviddf1

    Joined:
    Jan 19, 2018
    Posts:
    4
    Hey
    Anyone else have this issue... I did a local hard drive search for an openSDK folder, found several from other unity version installs, copied the entire //....PlaybackEngines/AndroidPlayer folder of one of them to the Version 2021.3.19 .../PlaybackEngines folder, and it worked.
     
  37. nadeemsaleem

    nadeemsaleem

    Joined:
    Jan 24, 2017
    Posts:
    1
    I have Same Issue
    upload_2023-3-18_17-23-49.png
    But in AndroidPlayer Folder there is no JDK, SDK and NDK folders
    upload_2023-3-18_17-26-0.png
    How can I Fix that Problem?
     
  38. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    You need to check Android SDK/NDK/JDK in Unity HUB when installing Unity.
     
  39. ickydime

    ickydime

    Joined:
    Nov 20, 2012
    Posts:
    110
    I had a similar issue in Unity 2022.3.5f1.

    A project was working on 2022.3.9f1. I then realized the rest of the team was on 2022.3.5f1 so I installed that and downgraded the project. 2022.3.5f1 (which installed SDK/NDK/JDK and all folders existed and were populated) kept saying it was missing the SDK/NDK/JDK and each had a yellow warning icon next to them. I figured something was wrong with the install so I deleted both 2022.3.9f1 and 2022.3.5f1 and then re-installed 2022.3.5f1. That didn't work. I then tried deleting the library folder since maybe downgrading the project broke something. Also didn't work.

    I then re-installed 2022.3.9f1 and copy and made 2022.3.5f1 point to the JDK/NDK/SDK in the 9f1 folders and that worked.

    Not asking for anyone to do anything about this. Just posting my notes in case it helps someone.
     
  40. Julydevelopergame

    Julydevelopergame

    Joined:
    Jun 10, 2023
    Posts:
    57
    guys where is unity 2018.1.2 jdk? i had to use android studio for android sdk. why unity 2018 doesn't allow android jdk and sdk and ndk? help.
     

    Attached Files:

  41. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    The JDK is being installed via HUB, also, note Unity 2018 is no longer supported, please switched to supported LTS, which Unity 2021.x or Unity 2022.x
     
  42. Julydevelopergame

    Julydevelopergame

    Joined:
    Jun 10, 2023
    Posts:
    57
    oh no :( oh well