Gradle is failed to fetch dependencies , admob ,in UNITY console , Gradle failed to fetched dependencies

I installed the plugin it work fine in unity … show in console dummy ad loaded and dummy ad showen
but on android device it do nothing then i read the logcat and found it says java.lang.classNotFoundException com.google.android.gms.ads.mobileads and if i try to resolve it from assets->play service resolver → android ->force resolve it then says that “Gradle is failed to fetch dependencies” below is the full error in unity console

Gradle failed to fetch dependencies.
Failed to run ‘I:\unitygames\poorCat-v1\Temp\PlayServicesResolverGradle\gradlew.bat -b “I:\unitygames\poorCat-v1\Temp\PlayServicesResolverGradle\PlayServicesResolver.scripts.download_artifacts.gradle” --no-daemon “-PANDROID_HOME=D:/Program Files (x86)/Android/android-sdk” “-PTARGET_DIR=I:\unitygames\poorCat-v1\Assets\Plugins\Android” “-PMAVEN_REPOS=https://maven.google.com/” “-PPACKAGES_TO_COPY=com.google.android.gms:play-services-games:10+;com.google.android.gms:play-services-nearby:10+;com.google.android.gms:play-services-auth:10+;com.google.android.gms:play-services-ads:12.0.1”’
stdout:
Unzipping C:\Users\Awais.gradle\wrapper\dists\gradle-4.2.1-bin\dajvke9o8kmaxbu0kc5gcgeju\gradle-4.2.1-bin.zip to C:\Users\Awais.gradle\wrapper\dists\gradle-4.2.1-bin\dajvke9o8kmaxbu0kc5gcgeju
stderr:
Exception in thread “main” java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
at org.gradle.wrapper.Install.unzip(Install.java:215)
at org.gradle.wrapper.Install.access$600(Install.java:27)
at org.gradle.wrapper.Install$1.call(Install.java:75)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
exit code: 1
UnityEngine.Debug:LogError(Object)
Google.Logger:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel)
GooglePlayServices.c__AnonStorey14:<>m__1F(Result)
GooglePlayServices.c__AnonStorey15:<>m__28()
GooglePlayServices.PlayServicesResolver:PumpUpdateQueue()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

although if I reslove it using just resolve instead of force resolve ,it says resolution succeeded

,I installed the plugin it work fine in unity … show in console dummy ad loaded and dummy ad showen
but on android device it do nothing

then i read the logcat and found it says
java.lang.classNotFoundException com.google.android.gms.ads.mobileads

and if i try to resolve it from assets->play service resolver → android ->force resolve it then says that “Gradle is failed to fetch dependencies”
below is the full error in unity console

Gradle failed to fetch dependencies.
Failed to run ‘I:\unitygames\poorCat-v1\Temp\PlayServicesResolverGradle\gradlew.bat -b “I:\unitygames\poorCat-v1\Temp\PlayServicesResolverGradle\PlayServicesResolver.scripts.download_artifacts.gradle” --no-daemon “-PANDROID_HOME=D:/Program Files (x86)/Android/android-sdk” “-PTARGET_DIR=I:\unitygames\poorCat-v1\Assets\Plugins\Android” “-PMAVEN_REPOS=https://maven.google.com/” “-PPACKAGES_TO_COPY=com.google.android.gms:play-services-games:10+;com.google.android.gms:play-services-nearby:10+;com.google.android.gms:play-services-auth:10+;com.google.android.gms:play-services-ads:12.0.1”’
stdout:
Unzipping C:\Users\Awais.gradle\wrapper\dists\gradle-4.2.1-bin\dajvke9o8kmaxbu0kc5gcgeju\gradle-4.2.1-bin.zip to C:\Users\Awais.gradle\wrapper\dists\gradle-4.2.1-bin\dajvke9o8kmaxbu0kc5gcgeju
stderr:
Exception in thread “main” java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
at org.gradle.wrapper.Install.unzip(Install.java:215)
at org.gradle.wrapper.Install.access$600(Install.java:27)
at org.gradle.wrapper.Install$1.call(Install.java:75)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
exit code: 1
UnityEngine.Debug:LogError(Object)
Google.Logger:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel)
GooglePlayServices.c__AnonStorey14:<>m__1F(Result)
GooglePlayServices.c__AnonStorey15:<>m__28()
GooglePlayServices.PlayServicesResolver:PumpUpdateQueue()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

although if I reslove it using just resolve instead of force resolve ,it says resolution succeeded

Old post but I was also getting an error similar to this and solved in by manually downloading the zip file found in C:\Users[Username].gradle\wrapper\dists\gradle-5.1.1-bin[Folder] from Gradle Distributions

So take note of the zip file already in there (mainly the version). Try manually extract it and if it is found to be corrupt delete everything in that folder and manually paste in the downloaded one.

Basically what I think is happening is due to my poor internet connection, the zip file didn’t download correctly so when you Force Resolve in Unity it’s trying to extract the zip file, but the file is corrupted… Maybe just completely removing the zip file works too (maybe it will redownload it automatically) but manually downloading it will ensure it’s correctly downloaded.

Also make sure you have an internet connection when you Force Resolve.

Your Admob ads show in game just click reslove instead of force resolve? ,Same force resolve always show above error.

Finally. This video Solved the Problem…!! Thanks!!!