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
BUILD FAILED in 0s
exit code: 1
How can I fix it?
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.
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.
- 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.
Enable Custom Main Gradle Template and Custom Gradle Properties Template
Then do Assets → External Dependency Manager → Android Resolver → Force Resolve
Thats work for me
I fixed it by correcting the company name.
All you have to do is enter Unity Hub and click on the install section from here, you should find the version of Unity you are using and then click on add modules and download IOS Build Support. If you do this, your problem will be solved