Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Bug how can I change the Android resolver directory?

Discussion in 'Android' started by mohaned1001, Jan 7, 2024.

  1. mohaned1001

    mohaned1001

    Joined:
    Dec 13, 2017
    Posts:
    8
    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?
     
  2. mohaned1001

    mohaned1001

    Joined:
    Dec 13, 2017
    Posts:
    8
    update: the issue is mostly from "iron source" only more specifically version 7.6.2.
    I created an empty Unity 2022.3.26f1 project and just added to it the "iron source" package and got the exact same issues (can't resolve and can't build).
    downloaded Unity 2021.3.4f1 created an empty project added only the "iron source" package and got the exact same issues.
    just unlucky if you downloaded this version I guess two days at least wasted digging through all Unity cache files.
    I don't know how to delete the post.
     
  3. mohaned1001

    mohaned1001

    Joined:
    Dec 13, 2017
    Posts:
    8
    last update: the issue was not from the "iron source" version, had to restart my windows and computer to fix it.