Could not find com.google.gms:google-services:9.0,0

六眼飞鱼酱① 提交于 2020-01-17 09:19:44

问题


The Sync failed when tried to add the dependency for google play service. The problem seem to its looking for the jar in C:/Program/Files/Android/Android Studio however my SDK is placed in C:\Android\sdk. However I also have Android Studio in Program Files where there are no jar for Google play services.

Information:Gradle tasks [clean, :app:generateDebugSources, :app:compileDebugSources] Error:A problem occurred configuring root project 'XXXXXX'.

Could not resolve all dependencies for configuration ':classpath'. Could not find com.google.gms:google-services:9.0.0. Searched in the following locations: file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/9.0.0/google-services-9.0.0.pom file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/9.0.0/google-services-9.0.0.jar https://jcenter.bintray.com/com/google/gms/google-services/9.0.0/google-services-9.0.0.pom https://jcenter.bintray.com/com/google/gms/google-services/9.0.0/google-services-9.0.0.jar Required by: :XXXXX:unspecified Information:BUILD FAILED Information:Total time: 6.148 secs Information:1 error Information:0 warnings Information:See complete output in console

Also my ANDROID_HOME is set to C:\Android\sdk. Please advise.


回答1:


By checking other SO question. You can find that Google Play Service updating to version 9.0.0 has a bug issue.

Some solution is by checking if you have enabled offline work for gradle, deselect Offline Work if it's checked. Then, confirm if you have latest version of Google services mentioned as dependencies in project level build.gradle: classpath 'com.google.gms:google-services:3.0.0'. Clean and build the project after the gradle sync completes.

Also, some people fixed it by just deleting the debug.keystore file found in the android folder.

Check this SO question for more information.



来源:https://stackoverflow.com/questions/37611298/could-not-find-com-google-gmsgoogle-services9-0-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!