简体   繁体   中英

React native Google Signin Fail When i will build release apk

我将使用谷歌登录它正在工作,但每当我创建发布时,它都无法正常工作

GoogleErrorcode : DEVELOPERERROR

Please check if Google Play App Signing is enabled from the Google Play Console -> Release Management -> App Signing.
Please try below steps:

1] You have to copy the SHA1 from the 'App signing certificate' section and need to add it to the Firebase projects general settings section.
2] Afterward need to regenerate the json file and add it to the project.
3] Re-generate the apk and the error will get resolved.

If folks are still having this issue and have stumbled across this as i did. Here's what i figured out for my react native android firebase project

THERE ARE MULTIPLE SHA-1's TO ADD IN FIREBASE

1. SHA-1 For Release Variant

This is found in the Keystore file. You would have to add it to your Firebase Console Project Settings

a. Get release variant SHA-1 by running command below from you RN project root

$ cd android && ./gradlew signingReport

b.Add the release SHA-1 from here to your Firebase Console Project Settings


2.SHA-1 After you upload to google play store for testing / prod rollout

a .SHA-1 is found in the left nav of your google playstore console. Setup -> App signing -> App signing key certificate

b.Add this to your Firebase Console Project Settings for google sign in to work in testing / prod

Solved by adding release keystore SHA-1 to firebase console.

Use below command to create release SHA-1 and Add it to firebase console:

keytool -list -v -keystore {keystore_name} -alias {alias_name}

Note : Apk not need to create again.

Yesterday same problem occurred to me.

Google has released a new signing service in playstore publish console in which google will signin your app with his keystore. After signing , it will give you a new SHA which you have to add in your firebase account.

see the image for the better understanding

enter image description here

I have got a solution to this problem. You have to put both SHA key ie SHA for debug Keystore file and SHA for release jks file, into the firebase project setting.

  • Go to: https://console.firebase.google.com/
  • Now choose your project
  • Click the setting button near Project Overview
  • Choose Project Setting
  • Enter both SHA1 (debug SHA1 and release SHA1) in SHA certificate fingerprint
  • Save it
  • Download the google-services.json file
  • Run npx react-native run-android --variant=release in terminal

It worked for me very well.

After than many time trying i got the solution.

In GoogleSignin.configure i was place android client it, that why i getting the error

Finally i will place the web client id( Here )

GoogleSignin.configure({
  iosClientId: 'client ID',
  webClientId: 'My Web client ID'
})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM