본문 바로가기
개발/Unity

문제해결)Unity)Gradle failed to fetch dependencies.

by 테샤르 2022. 12. 5.

Gradle failed to fetch dependencies.

Gradle Dependencies 에러가 발생했다.

이번에 Unity Version을 변경하면서 생긴 이슈로

에러 내용을 보면 간단하게 JAVA_HOME 의 환경변수가 맞지 않는다는 내용이 포함되어있다.

 

 

반응형

 

Gradle failed to fetch dependencies.


Failed to run 'C:\WORKSPACES\Personal_Project\Nonogram\Nonogram\Temp\PlayServicesResolverGradle\gradlew.bat --no-daemon -b "C:\WORKSPACES\Personal_Project\Nonogram\Nonogram\Temp\PlayServicesResolverGradle\PlayServicesResolver.scripts.download_artifacts.gradle" "-PANDROID_HOME=C:/Program Files/Unity/2021.3.14f1/Editor/Data/PlaybackEngines/AndroidPlayer\SDK" "-PTARGET_DIR=C:\WORKSPACES\Personal_Project\Nonogram\Nonogram\Assets\Plugins\Android" "-PMAVEN_REPOS=file:///C:/WORKSPACES/Personal_Project/Nonogram/Nonogram/Library/PackageCache/com.google.firebase.app@f8e53ebc48aa/Firebase/m2repository;file:///C:/WORKSPACES/Personal_Project/Nonogram/Nonogram/Library/PackageCache/com.google.firebase.auth@8821986a342c/Firebase/m2repository" "-PPACKAGES_TO_COPY=com.google.firebase:firebase-common:20.2.0;com.google.firebase:firebase-analytics:21.2.0;com.google.android.gms:play-services-base:18.1.0;com.google.firebase:firebase-app-unity:10.1.1;com.google.firebase:firebase-auth:21.1.0;com.google.firebase:firebase-auth-unity:10.1.1" "-PUSE_JETIFIER=0" "-PDATA_BINDING_VERSION=4.0.1"'
stdout:

ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Unity\2020.3.2f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

stderr:

exit code: 1

간단하게 현재 JAVA_HOME의 환경변수 경로를 확인해본다.

echo %JAVA_HOME%

다시 환경변수를 설정한다.

 

환경변수

(JAVA_HOME)

(PATH)

 

 

정상적으로 실행되는것을 확인할 수 있다.

 

 

★☆☆☆☆

 

반응형

댓글