I followed this video, but it always gives me this strange error. I don't understand it, especially

video : https://www.youtube.com/watch?v=vojHmGUGUGc&t=1604s error : ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNGoogleSignin' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes In fact, I don’t even understand the error to fix it myself or understand what this error means, so anyone who has gone through this experience, tell me.
Supabase
YouTube
Sign in with Google on Expo React Native
On native Android devices we can use the native Sign in with Google flow which uses the operating system's built-in functionalities to prompt the user for consent[0]. We can use the react-native-google-signin/google-signin library[1] to implement native Google Sign in into our Expo React native applications. Read the docs: https://supabase.co...
1 Reply
3Froto
3FrotoOP4h ago
import { supabase } from '@/lib/supabase';
import {
GoogleSignin,
statusCodes
} from '@react-native-google-signin/google-signin';
import { useColorScheme } from "nativewind";
import React, { useEffect } from 'react';
import { Button } from 'react-native-paper';
export default function GoogleLogin() {
const { colorScheme } = useColorScheme();
useEffect(() => {
GoogleSignin.configure({
scopes: ['***********'],
webClientId: '*************',
offlineAccess: true,
forceCodeForRefreshToken: true,
})
}, [])

return (
<Button
className="py-1 px-6 rounded-xl flex-row items-center justify-center mb-3"
buttonColor={colorScheme === "dark" ? "white" : "black"}
onPress={async () => {
try {
await GoogleSignin.hasPlayServices()
const userInfo = await GoogleSignin.signIn()
if (userInfo.data?.idToken) {
const { data, error } = await supabase.auth.signInWithIdToken({
provider: 'google',
token: userInfo.data.idToken,
})
console.log(error, data)
} else {
throw new Error('no ID token present!')
}
} catch (error: any) {
if (error.code === statusCodes.SIGN_IN_CANCELLED) {
console.log('User cancelled the login flow')
} else if (error.code === statusCodes.IN_PROGRESS) {
console.log('Sign-in in progress already')
} else if (error.code === statusCodes.PLAY_SERVICES_NOT_AVAILABLE) {
console.log('Play services not available or outdated')
} else {
console.error('Some other error:', error)
}
}
}} >
Continue with Google
</Button>
)
}
import { supabase } from '@/lib/supabase';
import {
GoogleSignin,
statusCodes
} from '@react-native-google-signin/google-signin';
import { useColorScheme } from "nativewind";
import React, { useEffect } from 'react';
import { Button } from 'react-native-paper';
export default function GoogleLogin() {
const { colorScheme } = useColorScheme();
useEffect(() => {
GoogleSignin.configure({
scopes: ['***********'],
webClientId: '*************',
offlineAccess: true,
forceCodeForRefreshToken: true,
})
}, [])

return (
<Button
className="py-1 px-6 rounded-xl flex-row items-center justify-center mb-3"
buttonColor={colorScheme === "dark" ? "white" : "black"}
onPress={async () => {
try {
await GoogleSignin.hasPlayServices()
const userInfo = await GoogleSignin.signIn()
if (userInfo.data?.idToken) {
const { data, error } = await supabase.auth.signInWithIdToken({
provider: 'google',
token: userInfo.data.idToken,
})
console.log(error, data)
} else {
throw new Error('no ID token present!')
}
} catch (error: any) {
if (error.code === statusCodes.SIGN_IN_CANCELLED) {
console.log('User cancelled the login flow')
} else if (error.code === statusCodes.IN_PROGRESS) {
console.log('Sign-in in progress already')
} else if (error.code === statusCodes.PLAY_SERVICES_NOT_AVAILABLE) {
console.log('Play services not available or outdated')
} else {
console.error('Some other error:', error)
}
}
}} >
Continue with Google
</Button>
)
}

Did you find this page helpful?