Unable to locate a Java Runtime - Android Build Export

When I was trying to export a build, I was getting this kind of error:

After adding AdMob library, I started getting this kind of error before within my project no external library exist.
Its saying Unable to Locate Java Runtime but I have already linked all external tools to default settings.

Check below image:

At present, I have just installed Unity 2021.3.3 because similar problem I have faced with Unity 2021.1.13 version so I upgraded to LTS version but still getting this error.

Please give me some suggestion for this.

Could you attach Editor.log containing your error?

Hello Sir, here you have editor log file, after I have started exporting a android build:

8147084–1058081–editor log file.pdf (107 KB)

Try unchecking the recommended option and finding the path to the tool manually. Looks like it helped other folks there - Unable to find java in the system path - Questions & Answers - Unity Discussions

2 Likes

Alternatively try executing this command from terminal

/Applications/Unity/Hub/Editor/2021.3.3f1/PlaybackEngines/AndroidPlayer/SDK/tools/bin/sdkmanager --list

This post’s answer worked for me too.
I have unchecked all recommended check box items and linked at the same place and it worked.

Sorry I have to reopen this thread because on other day I opened my project and it stopped exporting android build.
Just one day it worked and now it was not working though I have multiple times done the same step.

Here I am giving you console output after executing the command:
8150768--1058813--sdk manager command.png

Please help me into this.

These two steps helped me to run my project on MacOS and export Android build:

8 Likes

That worked for me, thanks for shareing the solution!

Thanks for the worked workaround. I face with this issue today in Unity 2022.3.5 LTS.

it doesnt work for me… any other suggestions?

Added “/” works for me, thanks!