Comments (11)
@muriukialex
I just got the ball rolling on my test app. Here is what seemed to make it work:
1
I removed the expo go app from the emulator entirely (i had used it previously, but it is not needed when running development builds).
2
Instead of using links like "npx uri-scheme open exp://192.168.0.10:8081/--/settings --android", i was now able to open with the link "npx uri-scheme open testlinking://settings" where testlinking is the project slug.
from google-signin.
Hello and thanks for reporting,
please follow the guide here https://github.com/react-native-google-signin/google-signin#expo-installation
namely, you need to build the app including the native files for this to work
Thank you 🙂
from google-signin.
Hi @vonovak. Thanks for the response, but already do this.
As mentioned in the end, i build my project using managed expo, so the command i use is
eas build --profile development --platform android
And when testing, i launch wit the dev-client flag.
npx expo start --dev-client
from google-signin.
can you try with the commands here? https://docs.expo.dev/workflow/customizing/#generate-native-projects-with-prebuild
If that does not work, I'm going to need a git repo that reproduces those issues
Thank you
from google-signin.
Hello @vonovak
I have the same issue here
Here' are my dependecies
{
"dependencies": {
"@react-native-google-signin/google-signin": "^10.1.0",
"expo": "~49.0.15",
"expo-status-bar": "~1.6.0",
"react": "18.2.0",
"react-native": "0.72.6",
"expo-splash-screen": "~0.20.5",
"expo-apple-authentication": "~6.1.0"
},
}
Built the Android and iOS native files using npx expo run:android
and npx expo run:ios
respectively
Did the native app linking as explained here after building my iOS native code ie. ran pod install
in ios/
directory to install the module
pod install
Here's the error I get
iOS Bundling complete 11288ms
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
ERROR Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called., js engine: hermes
Code that produces the error
import * as AppleAuthentication from 'expo-apple-authentication'
import { GoogleSignin, GoogleSigninButton, statusCodes } from '@react-native-google-signin/google-signin'
import { Platform, StyleSheet } from 'react-native'
export function Auth () {
if (Platform.OS === 'ios') {
return (
<AppleAuthentication.AppleAuthenticationButton
buttonType={AppleAuthentication.AppleAuthenticationButtonType.SIGN_IN}
buttonStyle={AppleAuthentication.AppleAuthenticationButtonStyle.BLACK}
cornerRadius={5}
style={styles.button}
onPress={async () => {
try {
const credential = await AppleAuthentication.signInAsync({
requestedScopes: [
AppleAuthentication.AppleAuthenticationScope.FULL_NAME,
AppleAuthentication.AppleAuthenticationScope.EMAIL,
],
})
console.log(JSON.stringify(credential, null, 2))
// signed in
} catch (e: any) {
if (e.code === 'ERR_REQUEST_CANCELED') {
// handle that the user canceled the sign-in flow
} else {
// handle other errors
}
}
}}
/>
)
}
GoogleSignin.configure({
scopes: ['https://www.googleapis.com/auth/drive.readonly'],
webClientId: 'my client ID',
})
return (
<GoogleSigninButton
size={GoogleSigninButton.Size.Wide}
color={GoogleSigninButton.Color.Dark}
onPress={async () => {
try {
await GoogleSignin.hasPlayServices()
const userInfo = await GoogleSignin.signIn()
console.log(JSON.stringify(userInfo, null, 2))
} catch (error: any) {
if (error.code === statusCodes.SIGN_IN_CANCELLED) {
// user cancelled the login flow
} else if (error.code === statusCodes.IN_PROGRESS) {
// operation (e.g. sign in) is in progress already
} else if (error.code === statusCodes.PLAY_SERVICES_NOT_AVAILABLE) {
// play services not available or outdated
} else {
// some other error happened
}
}
}}
/>
)
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
button: {
width: 200,
height: 44,
},
})
Did you manage to find a work around @SorenJ89?
from google-signin.
@muriukialex It is weird. I had my son's birthday this weekend, but i had time to upload a git repo this friday, but suddenly everything worked.
Now that I'm back to it again it doesn't work..
@vonovak Here is the repo with the steps to reproduce
https://github.com/SorenJ89/testlinking
from google-signin.
@SorenJ89 I checked your repro steps (I'm on the phone so I didn't clone your repro so there is a chance I missed something but it's very unlikely I think) and it appears the problem is that you're using expo go.
As explained in the readme, you need your own development build. Please follow the readme and read very very very carefully the linked expo docs.
That should fix your issue.
Hope this helps 🙂.
from google-signin.
Halo @vonovak I have the same problem, namely when running with expo start --dev-client, I still get an error
Error: RN GoogleSignin native module is not correctly linked. Please read the readme, setup and troubleshooting instructions carefully.
If you are using Expo, make sure you are using Custom dev client, not Expo go., js engine: hermes.
What's the solution?
Where can I see the correct linking tutorial on iOS?
from google-signin.
@nicholasas1 sorry you have an issue,
I suggest you read the documentation and the comments above. I'm confident that you'll get it working.
Thank you
from google-signin.
@vonovak does it only apply to sponsors?
from google-signin.
this error is not related to being / not being a sponsor
from google-signin.
Related Issues (20)
- My app shows google login panel, I changed the email and client Id in the code then get this error. HOT 1
- Sign in doesn't seem to be working in custom Expo Dev Client HOT 4
- URL Access Anti-virus Security issue HOT 2
- Restore Flow typings for v12 HOT 2
- [Docs] iOS docs unusable for Expo HOT 2
- Support for react-native-macos HOT 2
- Compatible version for react native 0.61.5 HOT 1
- Mock not working in 12.1.0 HOT 10
- Google Signin Works on Emulator but not on Web HOT 1
- Free Sponsor Access for Early-Stage Startups? HOT 2
- Unable to install sponsored version HOT 1
- Terminating app due to uncaught exception 'NSInvalidArgumentException' HOT 2
- Is there any cache in this library? reversed_client_id doesn't change even if Info.plist changed HOT 1
- Prevent crashes on mobile web HOT 1
- "[app] wants additional access to your Google Account" on re-sign-in on iOS. HOT 6
- google sign in not working when using an actual mobile: tried two views with the same name RNGoogleSigninButton HOT 6
- Cannot get signIn() working with Supabase HOT 20
- Dependency conflict between React and React Native versions when installing @react-native-google-signin/google-signin package HOT 9
- Framework 'hermes' not found HOT 1
- java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-signin.