google-signin: ERROR: RN GoogleSignin not linked & TypeError: Cannot read property 'SIGN_IN_CANCELLED' of null,
Hi i'm pretty new to mobile dev, i'm currently using RN with EXPO and firebase, and for some reason Google Sign In doesn't wanna work i'm getting these two errors :
ERROR; RN GoogleSignin native module is not correctly linked. Please read the readme, setup and troubleshooting instructions carefully or try manual linking. ERROR : TypeError: Cannot read property 'SIGN_IN_CANCELLED' of null, js engine: hermes
Installations:
npx expo install @react-native-google-signin/google-signin
npm install --save @react-native-firebase/app
npm i @react-native-firebase/auth
npx expo install expo-dev-client
eas build:configure
eas.json
"build": {
"development": {
"android":{
"buildType": "apk"
}
},
"preview": {
"android":{
"buildType": "apk"
}
},
"production": {
"android":{
"buildType": "apk"
}
}
},
Running this :
eas build
eas credentials # Got the SHA-1 certificat from here
After that in configured the project in firebase and put the SHA-1 for android, and activated the google auth
app.json :
"expo":{
"android":{
"googleServicesFile": "./google-services.json"
},
...
"plugins": [
"@react-native-firebase/app",
"@react-native-google-signin/google-signin"
],
}
eas build # generating the build to put on Android Studio emulator
npx expo start --dev-client
After Installing that i installed the build on the emulator and ran
npx expo start --dev-client
Code for the application :
GoogleSignin.configure({
offlineAccess: true,
scopes:["email","profile"],
webClientId:"WEB CLIENT ID FROM FIREBASE" ,
});
Dependencies:
package.json
{
"name": "frontend",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
"@react-native-async-storage/async-storage": "^1.19.1",
"@react-native-firebase/app": "^18.3.0",
"@react-native-firebase/auth": "^18.3.0",
"@react-native-google-signin/google-signin": "^10.0.1",
"@react-navigation/native-stack": "^6.9.13",
"@react-navigation/stack": "^6.3.17",
"@tanstack/react-query": "^4.32.0",
"@types/react": "~18.2.14",
"axios": "^1.4.0",
"expo": "~49.0.5",
"expo-dev-client": "~2.4.6",
"expo-splash-screen": "~0.20.4",
"expo-status-bar": "~1.6.0",
"nativewind": "^2.0.11",
"react": "18.2.0",
"react-native": "0.72.3",
"react-native-gesture-handler": "~2.12.0",
"react-native-reanimated": "~3.3.0",
"react-native-toast-notifications": "^3.3.1",
"tailwindcss": "^3.3.2",
"typescript": "^5.1.3",
"zustand": "^4.3.9"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@tsconfig/react-native": "^3.0.2",
"@types/jest": "^29.5.3",
"@types/react": "^18.2.16",
"@types/react-test-renderer": "^18.0.0",
"typescript": "^5.1.6"
},
"private": true
}
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 4
- Comments: 15 (4 by maintainers)
hello everyone, @paullam328 thanks for providing repro steps. You need to launch your app with the commands mentioned here https://docs.expo.dev/workflow/customizing/#generate-native-projects-with-prebuild (documented in the readme at https://github.com/react-native-google-signin/google-signin#expo-installation)
@Yanis540 I wasn’t able to reproduce the issue from the information you provided. If you’re stuck, feel free to reach out to me and I can fix your problem, as a paid service.
thank you!
HI ! Still the same issu even when rolling back to SDK48 on expo … but thank you