I checked the documentation, downloaded the example from the repo and no matter how hard I've tried to build the package it fails saying this:

mac os
```
"react": "16.3.1",
"react-native": "0.55.4",
"react-native-google-signin": "^0.12.0"
## Steps to Reproduce
just install the dependency itself
1. install the following dependencies in android sdk manager:
1.1 Android SDK Build-Tools: 23.01, 24.01
1.2 Android SDK Platform-Tools 28.0.0
1.3 Android SDK Tools 26.1.1
1.4 Android 6.0 SDK Platform, Google Ais
1.5 Andoroid 5.1.1 SDK Platform, Google Apis
1.6 Android Support Repository
2. edit /android/app/build.gradle add:
```
compile(project(':react-native-google-signin')){
exclude group: "com.google.android.gms"
}
compile "com.google.android.gms:play-services-auth:11.8.0"
// at the end of the file add this
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.gms:google-services:3.0.0'compile succesfully
Got an error when compiling:
Scanning folders for symlinks in /Users/egarcia/googleSigninDemo/node_modules (43ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
File /Users/egarcia/.android/repositories.cfg could not be loaded.
FAILURE: Build failed with an exception.
@erick2014 Same issue here.!!
@erick2014 same here!
Here is the fix, replace your android/build.gradle with this i.e in your project level gradle with this
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
maven {url "https://maven.google.com"} //<---- this should be added and should be aboce jcenter
maven {url "$rootDir/../node_modules/react-native/android"}
jcenter()
}
}
After that clear your gradle going inside android folder from cmd/terminal
gradlew clean
Then run the react native application
@ajitdas123 yeah it worked for me man thx a lot I jus want to say if you dont have the jcenter() at the end you will get this error, so keep that in mind :
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
> A problem occurred configuring project ':react-native-google-signin'.
> Could not find runtime.jar (android.arch.lifecycle:runtime:1.0.0).
Searched in the following locations:
https://jcenter.bintray.com/android/arch/lifecycle/runtime/1.0.0/runtime-1.0.0.jar
this is my build android/build.gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
maven {url "https://maven.google.com"}
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
jcenter()
}
}
and this is my /android/app/build.gradle file:
dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
compile(project(':react-native-google-signin')){
exclude group: "com.google.android.gms"
}
compile "com.google.android.gms:play-services-auth:11.8.0"
}
@ajitdas123 thanks! it worked on ./gradlew clean but later on i tried to run-android i have an error :app:compileDebugJavaWithJavac FAILED https://github.com/react-native-community/react-native-google-signin/issues/420
@ergxpr0xy check if you have this line apply plugin: 'com.google.gms.google-services' and remove it and try again
I also record a video about how to compile de dependency, maybe it could help
https://www.youtube.com/watch?v=mi9jBPGcwO0&t=6s
maven {url "https://maven.google.com"} //<---- this should be added and should be aboce jcenter
fixed this issue for me: https://github.com/react-native-community/react-native-google-signin/issues/417
It seems like we need to update the example docs:
https://github.com/react-native-community/react-native-google-signin/blob/master/android/build.gradle
@erick2014 @ujjwalagrawal17 @appai
Hey I got same issue. Make sure your graddle-wrapper version should be 4.4, gradle version should be 3.1.2 and play-service-auth version should be 15.0.0. If it is not then follow three steps to upgrade.
P.S : I'm using React-native Google Signin version v0.10.0.
I am using same version of RN Google Signin in 0.12.0 and I am able to build it successful. My advice is to you is that always Use same version of google play Services as in your case it is 12.8 and 11.8 at another place.
**compile 'com.google.android.gms:play-services-auth:11.8.0'** replace 11.8.0 version with you want to go but only condition is that it must be same in all libraries which are having gms:play-services or firebase-messaging firebase-core keywords.I _am pretty sure this will work, It will not only work here it will also work in all problem like FCM not working and many unexpected crashes. Feel Free to ask if you are still having this issue._
The solution is provided and reflected to our Android guide. Thanks everyone finding solutions! :)
@sanjeevmoga Your solution worked like a charm for my integration of react-native-facebook-account-kit! Thank you for that!
Most helpful comment
Here is the fix, replace your
android/build.gradlewith this i.e in your project level gradle with thisAfter that clear your gradle going inside android folder from cmd/terminal
gradlew cleanThen run the react native application