Gradle failed to fetch dependencies.
Failed to run 'D:\Temp\PlayServicesResolverGradle\gradlew.bat -b "D:\Temp\PlayServicesResolverGradle\PlayServicesResolver.scripts.download_artifacts.gradle" --no-daemon "-PANDROID_HOME=sdk-2" "-PTARGET_DIR=Game\Assets\Plugins\Android" "-PMAVEN_REPOS=https://maven.google.com" "-PPACKAGES_TO_COPY=com.google.android.gms:play-services-ads:11.6.0"'
stdout:
ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk1.8.0_144;
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
stderr:
exit code: 1
UnityEngine.Debug:LogError(Object)
Google.Logger:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel)
GooglePlayServices.<GradleResolution>c__AnonStorey14:<>m__1F(Result)
GooglePlayServices.<GradleResolution>c__AnonStorey15:<>m__28()
GooglePlayServices.PlayServicesResolver:PumpUpdateQueue()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
Hi @pawnakumar113,
_
The issue is this:
JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk1.8.0_144;
_
The solution (at least for windows users) is:
Right click on “my computer” and go to properties.
Go to the Advanced tab
Click on the Environmental Variables… button
Find the JAVA_HOME variable under System Variables
Change the value to wherever this file actually exists for you. (for me it was C:\Program Files\Java\jdk-10)