Search Unity

Bug mediation does not contain java

Discussion in 'Unity Mediation' started by KillitsGaming, Nov 10, 2021.

  1. KillitsGaming

    KillitsGaming

    Joined:
    Aug 24, 2014
    Posts:
    28
    Hi just added in mediation in to my game and this is what I get and wont go away. java_home environment references a directory (C:\Program Files\Unity\Hub\Editor\2020.3.22f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK) that does not contain java which is required to process android libraries. is what it is saying and this the error I get right after it.



    failed with exception: GooglePlayServices.JavaUtilities+ToolNotFoundException: jar not found, C:\Program Files\Unity\Hub\Editor\2020.3.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK references incomplete Java distribution.
    at GooglePlayServices.PlayServicesResolver.ExtractZip (System.String zipFile, System.Collections.Generic.IEnumerable`1[T] extractFilenames, System.String outputDirectory, System.Boolean update) [0x00130] in <17bf2caa78b94b298adbb078df707d24>:0
    at Google.GradleWrapper.Extract (Google.Logger logger) [0x00045] in <17bf2caa78b94b298adbb078df707d24>:0
    at GooglePlayServices.GradleResolver.GradleResolution (System.String destinationDirectory, System.String androidSdkPath, System.Boolean logErrorOnMissingArtifacts, System.Boolean closeWindowOnCompletion, System.Action`1[T] resolutionComplete) [0x0009f] in <17bf2caa78b94b298adbb078df707d24>:0
    at GooglePlayServices.GradleResolver.DoResolutionUnsafe (System.String destinationDirectory, System.Boolean closeWindowOnCompletion, System.Action resolutionComplete) [0x000ce] in <17bf2caa78b94b298adbb078df707d24>:0
    at GooglePlayServices.GradleResolver+<DoResolution>c__AnonStorey13.<>m__1D () [0x00000] in <17bf2caa78b94b298adbb078df707d24>:0
    at Google.RunOnMainThread.ExecuteNext () [0x0003d] in <c4a263630d3b4d428911d0a3ca380322>:0
    UnityEngine.Debug:LogError (object)
    Google.RunOnMainThread:ExecuteNext ()
    Google.RunOnMainThread:<ExecuteAll>m__A ()
    Google.RunOnMainThread:RunAction (System.Action)
    Google.RunOnMainThread:ExecuteAll ()
    Google.RunOnMainThread:Run (System.Action,bool)
    GooglePlayServices.GradleResolver:DoResolution (string,bool,System.Action)
    GooglePlayServices.PlayServicesResolver:ResolveUnsafe (System.Action`1<bool>,bool,bool,bool)
    GooglePlayServices.PlayServicesResolver/<ScheduleResolve>c__AnonStorey1E:<>m__3F ()
    GooglePlayServices.PlayServicesResolver:ExecuteNextResolveJob ()
    GooglePlayServices.PlayServicesResolver:ScheduleResolve (bool,bool,System.Action`1<bool>,bool)
    GooglePlayServices.PlayServicesResolver:AutoResolve (System.Action)
    GooglePlayServices.PlayServicesResolver:<ScheduleAutoResolve>m__47 ()
    Google.RunOnMainThread:ExecutePollingJobs ()
    Google.RunOnMainThread:<ExecuteAll>m__A ()
    Google.RunOnMainThread:RunAction (System.Action)
    Google.RunOnMainThread:ExecuteAll ()
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
     
  2. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    Hi @KillitsGaming,
    This error can have several causes, but in essence it means google play services resolver is unable to find your installation of java.
    We are aware of a bug with some versions of the resolver, and for this reason we recommend using the version packed with the mediation package (simply delete other versions, and you will get a popup asking if you want to install it).
    You can also go to the Unity->Preferences->External tools menu, and modify the path to your JDK. (This will also likely fix the bug if you are using another version of the resolver, simply toggle the checkboxes to use the default paths on and off, this should re-set the paths and temporarily fix the issue.)
    If the JAVA_HOME path is not where your java install is, you may also want to modify it.

    Please let us know if you are still experiencing issues.
    Cheers!