Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I fix RN GoogleSignin module linking.

Tags:

react-native

Every time I use Yarn everything blows up, which are the instructions given by the react-native-community.

I've tried just doing the npm install --save and then use the link command but nothing works so far.

What am i doing wrong? and how do i fix this.

onsole.error: "RN GoogleSignin native module is not correctly linked. Please read the readme, setup and troubleshooting instructions carefully or try manual linking."
like image 961
user3348354 Avatar asked Nov 07 '18 17:11

user3348354


3 Answers

I got this solved by just installing pos for the same:

Step 1: Goto the ios folder inside the app, Check for the pod file it must be having a line

  pod 'RNGoogleSignin', :path => '../node_modules/react-native-google-signin'

if it is not pleased run the command :

  react-native link, 

The above line will appear.

Step 2: Now run the following command.

 pod install 
like image 57
vishu2124 Avatar answered Nov 13 '22 20:11

vishu2124


I gave up on THE react googlesignin stuff after 2 days of tinkering.. I just followed the firebase guide and expo guide and everything works.

Expo google login gets the credentials then firebase checks the crednetials and logs you in.

if you are doing a firebase googlelogin thing and you already have firebase setup you can do something

googleLogin = async () => {
      try {
        const result = await Expo.Google.logInAsync({
          androidClientId: "Your Client ID",
          //iosClientId: YOUR_CLIENT_ID_HERE,  <-- if you use iOS
          scopes: ["profile", "email"]

        })
        if (result.type === "success") {
          const credential = firebase.auth.GoogleAuthProvider.credential(result.idToken, result.accessToken);
             firebase.auth().signInAndRetrieveDataWithCredential(credential).then(function(result){
               console.log(result);
             });
     this.props.navigation.navigate('Where you want to go');
   } else {
     console.log("cancelled")
   }
      } catch (e) {
        console.log("error", e)
      }
  }
like image 2
user3348354 Avatar answered Nov 13 '22 21:11

user3348354


For IOS,Please add this in your Pod file and do pod install before run-ios:

pod 'RNGoogleSignin', :path => '../node_modules/@react-native-community/google-signin'

I faced similar issue while manually upgrading react native from 0.59.9 to 0.62.2. I have also uninstalled react-native-google-signin and installed @react-native-community/google-signin before making Pod File change.

like image 2
Vikas Chowdhury Avatar answered Nov 13 '22 20:11

Vikas Chowdhury