Closed shyam528 closed 7 years ago
I have used android client id instead of webclient id . it is solved now
I have this problem. How did you fix it? I don't really get what you mean when you say android client id instead of web client id
@shyam528 please provide some more details how you solve it, what does it mean Android client id ?
@sherazi-maavan we can find Android Client Id from OAuth 2.0 client IDs section in here https://console.developers.google.com/apis/credentials?project=your_project_id .
In google developer console, in Credentials page you can find the Client Ids
@shyam528 Did you mean that we should you the web client ID instead of android client ID ?
@shyam528 (or anyone else reading along), did you mean for this step:
GoogleSignin.configure({
scopes: ['https://www.googleapis.com/auth/drive.readonly'], // what API you want to access on behalf of the user, default is email and profile
webClientId: '<FROM DEVELOPER CONSOLE>', // client ID of type WEB for your server (needed to verify user ID and offline access)
offlineAccess: true, // if you want to access Google API on behalf of the user FROM YOUR SERVER
hostedDomain: '', // specifies a hosted domain restriction
forceConsentPrompt: true, // [Android] if you want to show the authorization prompt at each login
accountName: '', // [Android] specifies an account name on the device that should be used
iosClientId: '<FROM DEVELOPER CONSOLE>', // [iOS] optional, if you want to specify the client ID of type iOS (otherwise, it is taken from GoogleService-Info.plist)
});
you put the android client id instead of the web id for the webClientId
field?
And to determine the android clientId versus the webClientId, if your google-services.json
looked something like this:
{
"project_info": {
"project_number": "12345678",
"firebase_url": "https://comcommyapp.firebaseio.com",
"project_id": "comcommyapp",
"storage_bucket": "comcommyapp.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:15564864124:android:4564asdfe48134",
"android_client_info": {
"package_name": "com.myapp.myapp"
}
},
"oauth_client": [
{
"client_id": "12345678-5a1sdadfasd5f1aasdfe561651.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.myapp.myapp",
"certificate_hash": "basdaf123451adfaer13451avbzzz"
}
},
{
"client_id": "12345678-asdfq323fawefaw45151aefafe1.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AI_Qj123R__aq31413fafb"
}
],
}
],
}
you'd use 12345678-5a1sdadfasd5f1aasdfe561651.apps.googleusercontent.com
for the webClientId instead of 12345678-asdfq323fawefaw45151aefafe1.apps.googleusercontent.com
?
I am currently using 12345678-asdfq323fawefaw45151aefafe1.apps.googleusercontent.com
, which seems to be working for some people, but I am also seeing the 12500
error for others :/
Edit: CC'ing #543 as it's related
any fix? experiencing this error..
same problems
I've added a potential solution over there : https://github.com/react-native-community/react-native-google-signin/issues/543#issuecomment-433362576
i'm created tutorial google sign https://youtu.be/E6Rdg0reKRI
GoogleSignin.hasPlayServices().then(()=>{
}).catch((err)=>{
console.log("Play service error", err.code, err.message);
})
GoogleSignin.configure({
scopes: ['https://www.googleapis.com/auth/drive.readonly'], // what API you want to access on behalf of the user, default is email and profile
ClientId:
});
}
use CliendId instead webClientid and get the CliendId from https://console.developers.google.com/apis/credentials?project = "Your project Name". Dont forget to replace cliendt id in google-servcies.json too.
any solution , i am facing this error. A non-recoverable sign in failure occurred
Check the id. The firebase id is diffeent from google console id.
Try this:
GoogleSignin.configure({
scopes: ['https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/drive.metadata', 'https://www.googleapis.com/auth/drive.appdata', 'https://www.googleapis.com/auth/drive.file', 'https://www.googleapis.com/auth/drive.metadata.readonly', 'https://www.googleapis.com/auth/drive.scripts', 'https://www.googleapis.com/auth/drive.readonly', 'https://www.googleapis.com/auth/drive.photos.readonly'],
ClientId:'........apps.googleusercontent.com',
});
This CliendId is not the id found in google-services. Is different fom firebase id.
@uendar sir, i did as you said,
and here below is my code...
sir, still getting error, plz help me sir. i am noob in react-native
Make sure you enable your project https://console.developers.google.com/apis/library/drive.googleapis.com...... and try. if there is any problem tell me :)
sir, still getting same error
i have enabled
Did you do the configuration as in document descrription?
On Tue, Dec 18, 2018 at 10:24 AM kalraneeraj24550 notifications@github.com wrote:
[image: screenshot from 2018-12-18 14-54-11] https://user-images.githubusercontent.com/44640902/50144276-cf8da680-02d4-11e9-9475-5aed49a5dd49.png i have enabled
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/react-native-community/react-native-google-signin/issues/265#issuecomment-448153276, or mute the thread https://github.com/notifications/unsubscribe-auth/ANQWJapx3n0NjV-B9wuRWwf89Dhh4fetks5u6LRagaJpZM4OmbGa .
yes sir, i did. which file would you like me to show you
well i can shate a demo project where react-native-google-signin works. You can check the configurations. If there are problems again write me
On Tue, Dec 18, 2018 at 10:29 AM kalraneeraj24550 notifications@github.com wrote:
yes sir, i did. which file would you like me to show you
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/react-native-community/react-native-google-signin/issues/265#issuecomment-448154729, or mute the thread https://github.com/notifications/unsubscribe-auth/ANQWJbXkR-Hd58PZ0YMjRY7XY3_yqikZks5u6LWEgaJpZM4OmbGa .
give me your email i can check your project if you want :)
On Tue, Dec 18, 2018 at 10:32 AM Endar Uliu endar8@gmail.com wrote:
well i can shate a demo project where react-native-google-signin works. You can check the configurations. If there are problems again write me
On Tue, Dec 18, 2018 at 10:29 AM kalraneeraj24550 < notifications@github.com> wrote:
yes sir, i did. which file would you like me to show you
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/react-native-community/react-native-google-signin/issues/265#issuecomment-448154729, or mute the thread https://github.com/notifications/unsubscribe-auth/ANQWJbXkR-Hd58PZ0YMjRY7XY3_yqikZks5u6LWEgaJpZM4OmbGa .
my email is neeraj.emilence@gmail.com yes you can check my project. thanks sir, for helping me
anyone plz suggest me, am still facing this issue. A non- recoverable signin failure occured 12500
I fixed by adding correct SHA certificate fingerprint to my firebase project. This key was by default for me: keytool -exportcert -keystore ~/.android/debug.keystore -list -v
how to get correct sha. bcoz i have already added SHA certificate. got by this command. keytool -exportcert -keystore ~/.android/debug.keystore -list -v. how can we get know that our sha is correct or not
tried almost all above solutions (enabled all the APIs from google console,tried both client id and weclient id,updated fingerprint) nothing solved my problem
Even i had the same error it took a whole day for me to solve it. It was because of the SHA -1 certificate problem. i gave the value from different keystore in the firebase ,hence google-services.json had some wrong client id which was making the request fail so i did the following steps. 1)deleted the SHA-1 key from firebase 2) generated the key (referring to this article ->[https://developers.google.com/android/guides/client-auth]) 3)placed the key in the fire base and generated new google -services.json file
always use :- keytool -exportcert -list -v -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
commond dont even change the path(in windows)
default password:-android
@ashwath20 sir, what did you mean by "gave the value from different keystore". i did the steps as you did am still facing the same error. and the web client id is same in firebase as same in google-services.json file. i have no idea where am lacking. sir, can you plz guide me
your client id is based on the SHA1 key you provide . so generate the key from "%USERPROFILE%.android\debug.keystore" @kalraneeraj24550
i have solved it by having sha-1 from android studio not by command line
In my case, I was getting this because I switched my system and that now had a different debug.keystore. Didn't know that initially, but when I did, I followed this and added the new SHA1 to firebase console. Worked for me!
http://developerextensions.com/help/230-Google-signin-returns-12500,-12501-error-code-
I had a same problem. I switched from one mac to another, and the SHA-1 is changed. I needed to generate new SHA-1 and update firebase console. Also after you add new SHA-1 to firebase, you need to download new google-services.json and replace with older one in your android project app folder. Thank you @amit-gitrepo for hint.
Set Support email in firebase settings
I searches and came across the following steps
https://console.developers.google.com
What worked for me:
cd ./android && ./gradlew signingReport
SHA1
of Task :app:signingReport
, Variant: debugAndroidTest
, Config: debug
Project Settings
, Android app
, add the SHA1
google-services.json
, put it in ./android/app
Authentication
, then Sign-in method
, then press Google
Web client ID
and use that for your GoogleSignin.configure({ webClientId: ... });
Web client ID
should be the same as listed in https://console.developers.google.com/apis/credentials?project=<your_project_id>
-> Credentials
-> OAuth 2 Client ID
-> Web Client
What worked for me:
cd ./android && ./gradlew signingReport
- Take the
SHA1
ofTask :app:signingReport
,Variant: debugAndroidTest
,Config: debug
- Update it the Firebase Console under
Project Settings
,Android app
, add theSHA1
- Download the
google-services.json
, put it in./android/app
- Go to
Authentication
, thenSign-in method
, then press- Take the
Web client ID
and use that for yourGoogleSignin.configure({ webClientId: ... });
- This
Web client ID
should be the same as listed inhttps://console.developers.google.com/apis/credentials?project=<your_project_id>
->Credentials
->OAuth 2 Client ID
->Web Client
Man, i want to kiss your foots, I was trying for two days and now it is working!!! Thank you so much
@jasperkuperus I'm trying all steps but I got this error on 'release Apk'
Error: A non-recoverable sign in failure occurred
Although In development I don't get any error and I can sign in!
What worked for me:
cd ./android && ./gradlew signingReport
- Take the
SHA1
ofTask :app:signingReport
,Variant: debugAndroidTest
,Config: debug
- Update it the Firebase Console under
Project Settings
,Android app
, add theSHA1
- Download the
google-services.json
, put it in./android/app
- Go to
Authentication
, thenSign-in method
, then press- Take the
Web client ID
and use that for yourGoogleSignin.configure({ webClientId: ... });
- This
Web client ID
should be the same as listed inhttps://console.developers.google.com/apis/credentials?project=<your_project_id>
->Credentials
->OAuth 2 Client ID
->Web Client
Thanks; Its working and proper steps to solve this issue .
What worked for me:
cd ./android && ./gradlew signingReport
- Take the
SHA1
ofTask :app:signingReport
,Variant: debugAndroidTest
,Config: debug
- Update it the Firebase Console under
Project Settings
,Android app
, add theSHA1
- Download the
google-services.json
, put it in./android/app
- Go to
Authentication
, thenSign-in method
, then press- Take the
Web client ID
and use that for yourGoogleSignin.configure({ webClientId: ... });
- This
Web client ID
should be the same as listed inhttps://console.developers.google.com/apis/credentials?project=<your_project_id>
->Credentials
->OAuth 2 Client ID
->Web Client
This instruction works for apk and local debugging. For.aab
builds it not works.
But it's easy to fix, go to:
play store console -> your app -> Release management -> App signing
Under "App signing certificate" section copy your SHA1 key and paste it as on 3rd step-
Project Settings
, Android app
, add the SHA1
try with a physical device since in the emulator it did not work but with the physical device yes, I followed the steps of @jasperkuperus
What worked for me:
cd ./android && ./gradlew signingReport
- Take the
SHA1
ofTask :app:signingReport
,Variant: debugAndroidTest
,Config: debug
- Update it the Firebase Console under
Project Settings
,Android app
, add theSHA1
- Download the
google-services.json
, put it in./android/app
- Go to
Authentication
, thenSign-in method
, then press- Take the
Web client ID
and use that for yourGoogleSignin.configure({ webClientId: ... });
- This
Web client ID
should be the same as listed inhttps://console.developers.google.com/apis/credentials?project=<your_project_id>
->Credentials
->OAuth 2 Client ID
->Web Client
I tried it in React Native CLI and worked! Maybe in expo project should be run in production mode.
What worked for me:
cd ./android && ./gradlew signingReport
- Take the
SHA1
ofTask :app:signingReport
,Variant: debugAndroidTest
,Config: debug
- Update it the Firebase Console under
Project Settings
,Android app
, add theSHA1
- Download the
google-services.json
, put it in./android/app
- Go to
Authentication
, thenSign-in method
, then press- Take the
Web client ID
and use that for yourGoogleSignin.configure({ webClientId: ... });
- This
Web client ID
should be the same as listed inhttps://console.developers.google.com/apis/credentials?project=<your_project_id>
->Credentials
->OAuth 2 Client ID
->Web Client
@jasperkuperus Should we not be using the SHA1 key thats linked to Task :react-native-community_google-signin:signingReport
instead?
its interesting to find out that the path of the signing Key you mentioned and Task :react-native-community_google-signin:signingReport
are not same. one is defined inside app the other is defined globally.
any thoughts on it?
@jasperkuperus Should we not be using the SHA1 key thats linked to
Task :react-native-community_google-signin:signingReport
instead? its interesting to find out that the path of the signing Key you mentioned andTask :react-native-community_google-signin:signingReport
are not same. one is defined inside app the other is defined globally. any thoughts on it?
Sorry, this is quite a long time ago. I don't really remember and I'm not very familiar with this. I just know that my approach worked for me. If what you propose is better, and works... Then that might be a better answer. But maybe a contributor can chime in on this? I have a lack of knowledge to properly answer your question.
Thanks @jasperkuperus !! Until an actual contributor can share their thoughts, https://github.com/react-native-google-signin/google-signin/issues/265#issuecomment-616072044 fixed my issue. 🙌 🚀
If anyone facing this issue still, don't use the default webClientId created by your firebase project. Create a new web client Id from the google cloud developer console for your project and use that instead.
What worked for me:
cd ./android && ./gradlew signingReport
- Take the
SHA1
ofTask :app:signingReport
,Variant: debugAndroidTest
,Config: debug
- Update it in the Firebase Console under
Project Settings
,Android app
, add theSHA1
- Download the
google-services.json
, put it in./android/app
- Go to
Authentication
, thenSign-in method
, then press- Take the
Web client ID
and use that for yourGoogleSignin.configure({ webClientId: ... });
- This
Web client ID
should be the same as listed inhttps://console.developers.google.com/apis/credentials?project=<your_project_id>
->Credentials
->OAuth 2 Client ID
->Web Client
I've been struggling with this for hours today and it finally solved my issue 😭 Thank you so much!
What worked for me:
cd ./android && ./gradlew signingReport
- Take the
SHA1
ofTask :app:signingReport
,Variant: debugAndroidTest
,Config: debug
- Update it the Firebase Console under
Project Settings
,Android app
, add theSHA1
- Download the
google-services.json
, put it in./android/app
- Go to
Authentication
, thenSign-in method
, then press- Take the
Web client ID
and use that for yourGoogleSignin.configure({ webClientId: ... });
- This
Web client ID
should be the same as listed inhttps://console.developers.google.com/apis/credentials?project=<your_project_id>
->Credentials
->OAuth 2 Client ID
->Web Client
This instruction works for apk and local debugging. For
.aab
builds it not works. But it's easy to fix, go to: play store console -> your app -> Release management -> App signing Under "App signing certificate" section copy your SHA1 key and paste it as on 3rd step- 3. Firebase Console underProject Settings
,Android app
, add theSHA1
My local app works properly but my release app on google play still getting this error. Following this step and now my release app on google play working properly! Thank you so much! You saved my day! @6pm
not worked for me :(
ok how works on emulator???
Hello, I have update the files as you described in doc. and I am getting below error { [GoogleSigninError: A non-recoverable sign in failure occurred] name: 'GoogleSigninError', code: 12500 }