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.
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.
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