android – @react-native-firebase/auth: app not authorized Error in signInWithPhoneNumber-ThrowExceptions

Exception or error:

I am trying to set up a react-native project with firebase to signInWithPhoneNumber functionality. I am receiving an error:

NativeFirebaseError: [auth/app-not-authorized] This app is not authorized to use Firebase Authentication. Please verify that the correct package name and SHA-1 are configured in the Firebase Console. [ App validation failed. Is app running on a physical device? ]

My Function call is as follows:

import auth from '@react-native-firebase/auth';

Screen Class
getOtp = async () => {

      .then(confirmResult =>

I have tried all the setup instructions for the Firebase connection.

The Steps I have tried are:

  • I have the same package name in the react-native android project and firebase console.
  • Added the SHA1 from signingReport to Firebase Console.
  • Copied the google-services.json to android/app Folder.
  • Linked the Firebase to Android Studio via Google Analytics.

Giving Dummy Mobile Number for Testing works and has no issue but not with actual mobile number.
In android studio debugger, I am getting error issue displaying:

I/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms:

D/Auth: signInWithPhoneNumber:verification:failed

package details in package.json:

    "@react-native-firebase/app": "^6.3.3",
    "@react-native-firebase/auth": "^6.3.3",
    "@react-native-firebase/firestore": "^6.3.3",
    "@react-native-firebase/functions": "^6.3.3",
    "@react-native-firebase/messaging": "^6.3.3",
    "@react-native-firebase/storage": "^6.3.3",
    "react": "^16.12.0",
    "react-native": "^0.61.5",

config in build.gradle(app):

dependencies {
    implementation ""
    //implementation ""
    implementation ""
    implementation ""
    implementation ''
    implementation ''

    implementation 'org.webkit:android-jsc:+'
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.0'
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.facebook.react:react-native:0.61.5"  // From node_modules
    implementation ""
    implementation ''
    implementation ""


config in build.gradle(projectname):

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        // googlePlayServicesVersion = "16.1.0"
        androidMapsUtilsVersion = "0.5+"
    repositories {
        maven { url "" }
        maven { url "" }
    dependencies {
        classpath ''
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
How to solve:

I think in order to prevent abuse the firebase phone authentication wont work in emulator. It only works with real device.

But if you want it for testing purpose then you should add use some testing phone number in firebase console that will work in emulator.

Go to your firebase console -> Authentication -> SIGN-IN Method -> Phone and check the “Phone numbers for testing (optional)” field.

enter image description here

Leave a Reply

Your email address will not be published. Required fields are marked *