Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Could not find com.google.gms:google-services:1.0. when adding google service plugin in build.gradle in android studio

I am integrating OAuth login for Google+ on my android application, following the tutorial.

According to the tutorial, I should add the Google Service plugin by adding classpath 'com.google.gms:google-services:1.0' dependency to top-level build.gradle in my android project.

However, when I sync the gradle with the changes, I see the error as follows:

Error:Could not find com.google.gms:google-services:1.0.

Searched in the following locations: file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/1.0/google-services-1.0.pom file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/1.0/google-services-1.0.jar https://jcenter.bintray.com/com/google/gms/google-services/1.0/google-services-1.0.pom https://jcenter.bintray.com/com/google/gms/google-services/1.0/google-services-1.0.jar

In my build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript {     repositories {         jcenter()     }     dependencies {         classpath 'com.android.tools.build:gradle:1.2.3'         classpath 'com.google.gms:google-services:1.0'     } }  allprojects {     repositories {         jcenter()     } } 

It seems that the android studio is not able to find google-services plugin from repositories.

Does anybody have the same issue? Or, am I missing something?

like image 421
makeasy Avatar asked May 29 '15 10:05

makeasy


1 Answers

I ran into the same issue today. In the samples they use this line instead: classpath 'com.google.gms:google-services:1.3.0-beta1' This works.

like image 116
Jonas Lüthke Avatar answered Oct 21 '22 05:10

Jonas Lüthke