-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔥 Error: [auth/invalid-app-credential] Invalid token while using signInWithPhoneNumber(phoneNumber) #8440
Comments
Hi there
That's not a valid version setup, and you are logging an issue on old versions --> https://invertase.io/blog/react-native-firebase-versioning
That's not something in our documentation and it has never been necessary for me. I wouldn't recommend it |
Hi Mike, But this broke my Android build. When I try to build in android I end up getting the following error Steps I’ve Tried So Far:
|
@PranavSRokade This seems counterintuitive, but set kotlinVersion to 2.0.21 (latest in the 2.0.x series) and it will work. Discovered this while troubleshooting similar over in react-native-google-mobile-ads (2.0.x appears to be able to consume 2.1.x artifacts, but still has great backwards-compatibility with react-native versions that are still in support, using kotlin 2.1.x requires a patch to react-native for older versions, or the not-released-yet 0.79 which has the patch in it) |
I tried changing the kotlinVersion to 2.0.21 in the android/build.gradle. But I still get the same error. |
I won't have time to fix your project-specific build error, apologies. https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh You can check the comments, and run the script and it will generate a clean react-native + react-native-firebase project that has no problems building with android If you examine the differences between the generated project and your project, it should work I don't reproduce a build error in that demonstrator or in our e2e tests so I'm going to close this as it won't result in a change in the repo and so isn't really actionable here |
Issue
I am encountering an issue while calling auth().signInWithPhoneNumber(phoneNumber) where Firebase Phone Authentication works perfectly on:
iOS simulator
Android real device
Android emulator
However, on a real iOS device, I get the following error when trying to verify the phone number:
[Error: [auth/invalid-app-credential] Invalid token.]
What I Have Tried
Project Files
Javascript
Click To Expand
package.json
:{
"name": "campconnection_mobile",
"version": "1.0.2",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start --reset-cache",
"test": "jest"
},
"dependencies": {
"@craftzdog/react-native-buffer": "^6.0.5",
"@invertase/react-native-apple-authentication": "^2.4.0",
"@react-native-async-storage/async-storage": "^2.0.0",
"@react-native-clipboard/clipboard": "^1.16.1",
"@react-native-community/blur": "^4.4.1",
"@react-native-community/datetimepicker": "^8.2.0",
"@react-native-community/netinfo": "^11.4.1",
"@react-native-firebase/app": "^20.5.0",
"@react-native-firebase/auth": "^20.5.0",
"@react-native-firebase/firestore": "^20.5.0",
"@react-native-firebase/functions": "^21.6.0",
"@react-native-firebase/storage": "^21.5.0",
"@react-native-google-signin/google-signin": "^11.0.1",
"@react-native-picker/picker": "^2.9.0",
"@react-native/gradle-plugin": "^0.76.1",
"@react-navigation/bottom-tabs": "^6.6.1",
"@react-navigation/native": "^6.1.18",
"@react-navigation/stack": "^6.4.1",
"@shopify/flash-list": "^1.7.2",
"@types/react-native-html-to-pdf": "^0.8.3",
"@types/suncalc": "^1.9.2",
"add": "^2.0.6",
"date-fns": "^4.1.0",
"expo": "^51.0.0",
"expo-av": "~14.0.7",
"expo-clipboard": "~6.0.3",
"expo-file-system": "~17.0.1",
"expo-speech": "~12.0.2",
"gapi-script": "^1.2.0",
"react": "18.3.1",
"react-native": "^0.75.3",
"react-native-asset": "^2.1.1",
"react-native-config": "^1.5.3",
"react-native-date-picker": "^5.0.7",
"react-native-document-picker": "^9.3.1",
"react-native-drax": "^0.10.3",
"react-native-fast-image": "^8.6.3",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "^2.19.0",
"react-native-html-to-pdf": "^0.12.0",
"react-native-image-picker": "^7.1.2",
"react-native-linear-gradient": "^2.8.3",
"react-native-maps": "^1.20.1",
"react-native-modal": "^13.0.1",
"react-native-modal-datetime-picker": "^18.0.0",
"react-native-month-year-picker": "^1.9.0",
"react-native-pell-rich-editor": "^1.9.0",
"react-native-permissions": "^5.1.0",
"react-native-reanimated": "~3.16.1",
"react-native-render-html": "6.3.4",
"react-native-safe-area-context": "^4.11.0",
"react-native-screens": "^3.34.0",
"react-native-share": "^12.0.9",
"react-native-svg": "^15.7.1",
"react-native-swiper": "^1.6.0",
"react-native-video": "^6.8.2",
"react-native-vision-camera": "^4.6.1",
"react-native-webview": "^13.12.4",
"reanimated-color-picker": "^3.0.4",
"rfdc": "^1.4.1",
"rn-fetch-blob": "^0.12.0",
"suncalc": "^1.9.0",
"yarn": "^1.22.22"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "0.75.3",
"@react-native/eslint-config": "0.75.3",
"@react-native/metro-config": "0.75.3",
"@react-native/typescript-config": "0.75.3",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"babel-plugin-module-resolver": "^5.0.2",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "18.3.1",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
},
"packageManager": "[email protected]"
}
# N/A
firebase.json
for react-native-firebase v6:# N/A
iOS
Click To Expand
ios/Podfile
:AppDelegate.m
:Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:android/app/build.gradle
:android/settings.gradle
:MainApplication.kt
:AndroidManifest.xml
:Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:20.5.0
Firebase
module(s) you're using that has the issue:Auth (Phone Authentication)
TypeScript
?Y
&5.0.4
The text was updated successfully, but these errors were encountered: