unity-builder: JDK not found
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:
2023-01-09T11:27:13.6923522Z DisplayProgressbar: Detect Java Development Kit (JDK)
2023-01-09T11:27:13.9736423Z UnityException: JDK not found
2023-01-09T11:27:13.9737808Z Java Development Kit (JDK) directory is not set or invalid. Please, fix it in Edit / Unity -> Preferences -> External Tools
2023-01-09T11:27:13.9739136Z UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, String, BuildTargetGroup, BuildTarget, Int32, BuildOptions, String[], Boolean)
2023-01-09T11:27:13.9740684Z UnityEditor.BuildPipeline:BuildPlayerInternal(String[], String, String, BuildTargetGroup, BuildTarget, Int32, BuildOptions, String[]) (at /home/bokken/build/output/unity/unity/Editor/Mono/BuildPipeline.bindings.cs:481)
2023-01-09T11:27:13.9742309Z UnityEditor.BuildPipeline:BuildPlayer(String[], String, String, BuildTargetGroup, BuildTarget, Int32, BuildOptions, String[]) (at /home/bokken/build/output/unity/unity/Editor/Mono/BuildPipeline.bindings.cs:359)
2023-01-09T11:27:13.9744078Z UnityEditor.BuildPipeline:BuildPlayer(BuildPlayerOptions) (at /home/bokken/build/output/unity/unity/Editor/Mono/BuildPipeline.bindings.cs:323)
2023-01-09T11:27:13.9745377Z UnityBuilderAction.Builder:BuildProject() (at Assets/Editor/Editor/UnityBuilderAction/Builder.cs:71)
In Preferences -> External Tools the check box is set for JDK 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
...
unityVersion:
- 2022.2.1f1
targetPlatform:
- Android # does NOT work at the moment
- iOS # does work
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 15 (6 by maintainers)
One of the discord members seems to have gotten Unity to fix the issue: https://discord.com/channels/710946343828455455/1053868095615283211/1065926313661181952
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
@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.
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.