0
votes

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

1 Answers

0
votes

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.