Closed achimmihca closed 1 year ago
This is unity's problem. Unluckily recent version has this bug. It's not setting the correct JDK to the editor on installation. I faced this error one week ago, and there is no easy workaround.
For reference, this was brought up on the GameCI Discord: https://discord.com/channels/710946343828455455/1053868095615283211
Seems to be fixed in Unity 2022.2.2f1
Sorry, was celebrating too early. The issue still occurrs in Unity 2022.2.2f1
Related post on Unity forums: https://forum.unity.com/threads/unity-hub-cli-does-not-install-android-jdk.1375761/#post-8670387
This forum post names a different cause: file permissions are not set properly. I guess this could be fixed easily on our side.
One of the discord members seems to have gotten Unity to fix the issue: https://discord.com/channels/710946343828455455/1053868095615283211/1065926313661181952
Any news on this issue?
Still waiting on Unity to release an update unfortunately
The solution is quite simple.
This problem is not entirely related to Unity. To be more concretical, this is the issue with outdated version of Unity Hub. You have to update it to the latest one (currently 3.4.1 will be the minimal compatible) to get a working installation of OpenJDK.
An output of OpenJDK version command that installed along with 2022.2.8 via Unity Hub 3.4.1:
alex@CLI6:~$ ~/Unity/Hub/Editor/2022.2.8f1/Editor/Data/PlaybackEngines/AndroidPlayer/OpenJDK/bin/java -version
openjdk version "11.0.14.1" 2022-02-08
OpenJDK Runtime Environment Temurin-11.0.14.1+1 (build 11.0.14.1+1)
OpenJDK 64-Bit Server VM Temurin-11.0.14.1+1 (build 11.0.14.1+1, mixed mode)
To get it to work with CI Docker images just change hubVersion
argument https://github.com/game-ci/docker/blob/main/images/ubuntu/hub/Dockerfile and rebuild the hub image, after that rebuild the engine image.
UPD: just realized that the bug only persists while installing modules in headless mode. If you install OpenJDK using UI, the resulted modules.json layout will be different and it will contain the URL to JDK 11. Need to dig it deeper.
@CheeryLee Please see this thread here: https://discord.com/channels/710946343828455455/1053868095615283211
TLDR: Unity has fixed it internally, we are waiting for hub to release 3.5. There are also additional steps needed like fixing the errors thrown by new hub versions due to gpu acceleration and if Unity doesn't fix the sym link issue we need to bake the sym link fix into the images as well.
@AndrewKahr unfortunately for unknown reason I have no access to this server. However, if the problem will be fixed in 3.5 then it's nice. I'll stay tuned. Thank you for the info.
Just a side note, but there's an issue with the internal discord links you are sharing here.
So this seams to be a quite close circle discussion. Does someone know a workaround for the issue?
It's not a private discord or close circle in any way.
It's actually the community (public) home. You can use this invite until someone fixes the url: https://discord.gg/ZjpyhCRd
Edit: Issue is fixed in https://github.com/game-ci/documentation/pull/374
Weird that discord doesn't just give the option to join. I copied the link for the thread so it would link directly to the right message. Didn't know it wouldn't just let you join if you haven't already.
I installed Unity 2022.1.24f1 by Unity Hub version 3.9.0. And got an error:
UnityException: JDK not found Java Development Kit (JDK) directory is not set or invalid. Please, fix it in Edit / Unity -> Preferences -> External Tools
At Preferences->External Tools i see error/warning: "You are missing the recommended JDK. Install the recommended version using Unity Hub."
And i can't build the project. How can this be fixed?
Bug description
I just upgraded to Unity 2022.2.1f1 and game-ci/unity-builder@v2.1.2 The build for most platforms works fine.
Only Android build has issues because the JDK is not found:
In
Preferences -> External Tools
the check box is set forJDK installed with Unity (recommended)
.I see Docker Hub has some images with
android
in its name. Do I have to use a specific image?Expected behavior
The Docker image should include the JDK at the expected location.
Additional details
Please find the GitHub Actions yml configuration here and the program output here
So far, I just specified