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

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.

4 Likes

Hi, probably something failed during the installation. The “OpenJDK” directory in your screenshot is missing “include” and “bin” directories. Please try to reinstall it.

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.

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

I did a third reinstallation and this time I got this in the error logs:

{"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"}
{"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'execInstaller' ]","timestamp":"2021-08-03T15:04:30.796Z"}
{"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'installFromExe' ]","timestamp":"2021-08-03T15:04:30.797Z"}
{"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"}
{"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'execInstaller' ]","timestamp":"2021-08-03T15:04:30.803Z"}
{"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'installFromZip' ]","timestamp":"2021-08-03T15:04:30.804Z"}
{"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'execInstaller' ]","timestamp":"2021-08-03T15:04:30.804Z"}
{"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'installFromZip' ]","timestamp":"2021-08-03T15:04:30.804Z"}
{"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'execInstaller' ]","timestamp":"2021-08-03T15:04:30.805Z"}
{"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'installFromZip' ]","timestamp":"2021-08-03T15:04:30.805Z"}
{"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'execInstaller' ]","timestamp":"2021-08-03T15:04:30.805Z"}
{"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'installFromZip' ]","timestamp":"2021-08-03T15:04:30.805Z"}
{"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'execInstaller' ]","timestamp":"2021-08-03T15:04:30.805Z"}
{"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'installFromZip' ]","timestamp":"2021-08-03T15:04:30.805Z"}
{"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'execInstaller' ]","timestamp":"2021-08-03T15:04:30.806Z"}
{"moduleName":"UnityInstallStepsWindows","level":"debug","message":"[ 'installFromZip' ]","timestamp":"2021-08-03T15:04:30.806Z"}
{"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"}
{"moduleName":"UnityInstallStepsWindows","level":"info","message":"[ 'unzip finished' ]","timestamp":"2021-08-03T15:04:33.484Z"}

and

7385405--901373--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).

And I also see this error several times in the logs:

{"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"}

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”?

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?

Ok, I have a simple workaround to correct the missing content in any editor version.

  • Got to your editor version. e.g. C:\Program Files\Unity\Hub\Editor\2020.3.16f1
  • Open the modules.json file. (I used notepad, but ensure it is not to default).
  • Scroll to the bottom and will find the downloadURL associated with openJDK.
  • Copy the whole link to your web browser and download the zip file.
  • 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/

5 Likes

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.

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

Yes, this is a high priority issue for the Hub beta. The hub team is working on a fix.

1 Like

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?

Unfortunately we can’t do that due to licensing.

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.

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.

1 Like

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.

1 Like

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!

This worked for me Linux mint 20.3 Unity Hub 3.0.1 Unity 2020.3.30f1

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.

2 Likes