Solution for "Developer Error" In React Native Google Authentication
"Developer Error" In React Native Google Authentication
So in this post, I am gonna show you how you will figure out the developer error in react native google authentication like this is a common error while you start learning about google authentication so make sure anything you are doing of installing any type of dependencies must follow the whole documentation properly because this is the major issue while start learning new technology or something other you are doing is your project so let's start about this topic.
Dependencies
For RN >= 0.60 please use version installed from @react-native-google-signin/google-signinyarn add @react-native-google-signin/google-signin
For RN <= 0.59 use version 2 installed from react-native-google-signin
yarn add react-native-google-signin
Make sure you properly installed this dependency in your project follow this documentation link below
So this error is shown to you because you haven't configured the SHA-1 keys in your firebase or it may be deleted from you from the google cloud console so no need to worry about that you just delete your SHA-1 keys and again copy the right SHA-1 keys for debugging as well as for the release also
So in react native firebase authentication you must have the included three types of SHA-1 keys to your project
1. for debugging app debug SHA-1 signing key
2. for release app release SHA-1 signing key
3. while uploading to play store need play store SHA-1 app signing key
these three types of SHA-1 keys allow the google authentication for your application for debugging, release type of application.
all these types of SHA-1 keys you can find using gradlew or using keytool command also and paste it to your firebase project
or also you can use keytool where you installed java
in Linux => /opt/android-studio/jre
type the command for debug Keystore
type the command for release Keystore
$ keytool -genkeypair -v -keystore my-upload-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
after pasting the SHA-1 keys firebase automatically create web-client id and android client id in google cloud console so make sure the latest client id's of both android as well as web must using in your code
and in firebase.
Copy both SHA-1 keys and paste in the firebase project fingerprints and download the latest google-servies.json file put it in android/app/ directory and again rebuild the application using npx react-native run-android make sure you have both debug.keystore and my-upload-key.keystore in your android/app/
Conclusion
So after following the above steps you will be able to figure out the developer error in react native google authentication make sure you follow all steps and keep follow each instruction while doing any such type of setups. I hope this article helps you to figure out the developer error.
Comments
Post a Comment