- Home /
"Gradle failed to fetch dependencies"
I am trying to resolve android dependancies to install the admob plugin inside unity, but when i start, it freeze and appears an error "Gradle failed to fetch dependancies". I am using unity 2020.1.5f1. I tried to force resolve but the problem persists. In the bottom of the error appears this:
FAILURE: Build failed with an exception.
What went wrong: Could not create an instance of type org.gradle.initialization.DefaultSettings_Decorated.
Could not initialize class org.codehaus.groovy.reflection.ReflectionCache
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 0s
exit code: 1
How can I fix it?
Answer by vctr_ro · Jan 27, 2021 at 02:40 PM
If you are using Custom Keystore in Project Settings -> Player -> Publishing Settings, enter your passwords in the both fields. Then go to Assets -> External Dependency Manager -> Android Resolver -> Force Resolve.
Answer by BerndRos · Oct 18, 2020 at 08:52 AM
In my case, Unity does not seem to be using the JDK / SDK that was installed with Unity, although the check mark is set. Another path was in the background (check mark not set). If I set this path to Unity's JDK / SDK then my project works.
Caution:
This path is then set for all projects on the computer!
Sometimes I have to uncheck JDK after starting the Unity editor and set it again so that the * .aab is created.