- Home /
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:<>m1F(Result) GooglePlayServices.cAnonStorey15:<>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:<>m1F(Result) GooglePlayServices.cAnonStorey15:<>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
facing the exact same problem. Did you found any solution?
Answer by Wichael · Jun 13, 2020 at 02:05 PM
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 https://services.gradle.org/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.
Hello, sir thank you very much You just saved my time. been working 3 days with this error now I got the solution. bravo. thanks again
Answer by Mr-Asad955 · Nov 12, 2020 at 05:42 PM
Finally. This video Solved the Problem...!! Thanks!!! https://youtu.be/cIa8PK3QGUw
Answer by Kamran-Mahmood · May 30, 2018 at 12:18 PM
Your Admob ads show in game just click reslove instead of force resolve? ,Same force resolve always show above error.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Spammed with NullReference error because of Google Play Services 0 Answers