am using only Unity 2022.3.26f1, I have multiple projects (using Unity 2022.3.26f1) that can resolve Android dependencies with no issues, some of them are upgraded from older versions of Unity, except for one project (using Unity 2022.3.26f1) when I click resolve it will show two warning windows after each other:
“JAVA_HOME environment references a directory (C:\Program Files\Unity\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK) that does not contain java which is required to process Android libraries.”
“JAVA_HOME environment references a directory (C:\Program Files\Unity\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK) that does not contain jar which is required to process Android libraries.”
then it will print these to the console:
“Failed with exception GooglePlayServices.JavaUtilities+ToolNotFoundException: jar not found, C:\Program Files\Unity\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK references incomplete Java distribution. …more”
“Job failed with exception: GooglePlayServices.JavaUtilities+ToolNotFoundException: jar not found, C:\Program Files\Unity\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK references incomplete Java distribution. …more”
when I try to build APK (am trying to build “iron source demo”) it will show “Building scene 0: IronSourceDmo” and will stay forever (waited for an hour) even when I click cancel the build.
the main issue is the resolver is looking for the tools in the “Unity\2021.3.4f1” while this directory doesn’t exist anymore, so I suspect this directory is saved somewhere in some cache file, what is this file how can I change the directory in it?, this project has been upgraded from an older unity version, and am not sure but I think it was downgraded too once (it was working normally before I try to resolve the android dependencies so I can use iron source).
when I usually face issues like this most of the time I move everything to a new project, and this will always work, but in this case, the project is fully done, am just adding the ads, and the project has MANY performance settings, so it will take a long time moving it.
here are a few of the solutions I tried and they didn’t work (if the solution is out there, or is provided by any chat AI this means I tried it):
1- Set JAVA_HOME Environment Variable.
2- uncheck then check Unity Preferences (did it many times in different configurations like keeping it unchecked and manually setting the correct path).
3- Remove the “Library” file.
4- Reimport the Project.
5-Reinstall Unity(Unity 2022.3.26f1 and am 100% sure the android tools are included).
6- checked “ProjectSettings/ProjectVersion.txt”.
so in conclusion how can i change the path the Android dependencies resolver uses?