As per version 2019.3.12f1, and last Unity Hub version, I can’t install OpenJDK. It says the component is missing, and I go to Add modules, check the Open JDK, under Android. It starts downloading, installing, but nothing changes, actually.
Sometimes there’s an error message on Unity Hub saying that all files were not downloaded or are corrupted.
I have another version here, 2019.3.0f6 that has OpenJDK working fine. Then I simply tried copying & pasting files from OpenJDK to that current version. Editor recognizes it, but when building it fails.
I had this issue yesterday and found a suggestion on another thread to temporarily disable Avast while doing the Android and OpenJDK install in Unity Hub. I set Avast to disable for 10 minutes and the install using Unity Hub worked. I suspect it is the virus checker silently denying the connection driven by Unity Hub to get the OpenJDK.
I ended up copying the OpenJDK directory from an older version ( 2019.3.5f1 ), and it seems to work okay. But this is only a workaround. Unity needs to get this fixed.
Same issue here, I tried on 2020.2.0a18 it didn’t download
link to oracle doesn’t work
I also tried to download it via the 2019.3.0f6 version still not downloaded.
Got it from 2018.4.25f1 however it states that it’s not the recommended JDK and that I should install from Unity Hub which doesn’t want to work.
Same issue here , I have another version here, 2019.3.0f6 that has OpenJDK working fine. Then I simply tried copying & pasting files from OpenJDK to that current version.
So I got this problem because Unity Hub doesn’t have Admin privilege, even though my current Window account has it.
You have two options:
Install Unity Editor in any drive other than C where you have full control, write, edit permission without having to provide it through Window’s shitty permission system
Follow instruction in this answer to gain full control over your folders
1 Open This Pc
2 Right Click On Local Disk C:
3 Click on Properties
4 Select the Security tab
5 Click on Advanced
You may add your windows username by clicking on Add or select the [YourComputer]>\Administrators and Click Edit
Step 6
Click On Show Advanced Permissions at the right corner of the form.
Check Full Control and Press OK and close all windows.
I believe many people might be facing this issue. After running pillar to post and reading hundreds of posts on many forums, I was able to resolve the issue.
Disable any anti virus before installing Unity Hub or Unity Editor. I have Norton so disabled it first.
DO NOT download Unity Hub Beta. I have installed it first and problem has started from there. Install Unity Hub - 2.4.5. This is the version which solved my issue.
Start Unity Hub - 2.4.5 as “Run as Administrator”.
Add Unity Editor - 2020.3.20f1 release but DO NOT select Android module. This will be installed later.
Let Unity Editor installs properly.
Then select this installation in the Hub and select Add Module. Here select Android Build Support. Expand it and select both sub-options SDK, NDK and OpenJDK.
Let Android module installs properly
Locate your project in Unity Hub and click to load it in Unity Editor.
Copy the OpenJDK path from Preferences >> External Tools.
10 Go to Windows Environment Variables. Add JAVA_HOME variables in both Users and System variables section. Paste the OpenJDK path there. You may need to restart the PC to take these variables into effect. But I am not sure. Do so if you see a warning about it in Unity Editor
Come back to Unity Editor and try to build the project.
If you get a warning about obsolete Android SDK, click on Update SDK button.
You Android build should be done after that (apk or aab). At least it built in my case.
This is really frustrating problem, after experiencing this same issue, I’ve done some research on how to fix this problem, others said that you need to disable Avast, but I don’t have Avast or whatever antiviruses, I’ve done opening it as a system administrator, I’ve disabled my firewall, and also disabled the real-time protection on windows defender, I’ve done all of that but still no answer for me.
Until, I’ve been curious about if this problem is actually going on the network side(because when I actually want to download it manually from the link in the module.json, it just said that the site can’t be reached), so I’ve done a solution that I’ve seen no one mentioned before in the forum. I think this problem has a correlation with the proxy server or whatever(correct me if I’m wrong), but using VPN(in my case, I used cloudfare WARP) would fix the problem. So, good luck and stay strong guys.