Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Flutter and app store releases

Firebase phone sign-in sends no SMS and logs Error code:39

Your error

[SmsRetrieverHelper] SMS verification code request failed: unknown status code: 17499 Error code:391 more line it can show

Fix it fast

Most common cause, 1 of 2

One phone number got too many codes in a short time

Stop testing with real numbers.

Fix
await FirebaseAuth.instance.verifyPhoneNumber(
  phoneNumber: '+1 650-555-3434', // fictional number added in the console
  verificationCompleted: (PhoneAuthCredential credential) {},
  verificationFailed: (FirebaseAuthException e) => debugPrint('${e.code}: ${e.message}'),
  codeSent: (String verificationId, int? resendToken) {},
  codeAutoRetrievalTimeout: (String verificationId) {},
);
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

“SMS verification code request failed: unknown status code: 17499 Error code:39” means Firebase did not send the code. Firebase contributors tie it to throttling after too many codes to one number, and to carriers or regions paused for low delivery rates. Use fictional test numbers while developing and retry real ones later. Applies to firebase_auth 7.1.0 on Android.

  • Applies to firebase_auth 7.1.0 (Flutter), Flutter 3.50.1, Firebase Authentication on Android
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

Watch the Firebase Auth log while you request a code twice: once for a fictional number from the console, once for the real number. If the fictional number reaches codeSent and the real one fails with Error code:39, the call itself is fine and the refusal comes from the SMS side.

Run this first
adb logcat -s FirebaseAuth

Then find the line you see in this list and open its fix:

  1. 1One phone number got too many codes in a short timeThe same real number worked earlier in the day, then fails after repeated test runs, while other numbers still get codes
  2. 2The user's carrier or region is paused for low delivery successNumbers from one country code or one mobile network fail on the very first try, while numbers on other networks work

What does the error look like?

  • [SmsRetrieverHelper] SMS verification code request failed: unknown status code: 17499 Error code:39
  • An internal error has occurred. [ Error code:39 ]

Cause 1 of 2

One phone number got too many codes in a short time

You seeThe same real number worked earlier in the day, then fails after repeated test runs, while other numbers still get codes

Check

Error code:39 with status 17499 often follows a burst of sign-in attempts on a single number; a FlutterFire contributor closed one such report as exactly that. Firebase caps how many verification SMS a project can send to one phone number within a time window, and also limits requests and sent SMS per IP address. Past that cap, requests are throttled.

Check
adb logcat -s FirebaseAuth | grep "Error code:39"

Fix

Stop testing with real numbers. Add up to 10 fictional numbers with fixed codes under Phone numbers for testing in the Authentication sign-in settings, use them in development, and wait before retrying the real number.

Fix
await FirebaseAuth.instance.verifyPhoneNumber(
  phoneNumber: '+1 650-555-3434', // fictional number added in the console
  verificationCompleted: (PhoneAuthCredential credential) {},
  verificationFailed: (FirebaseAuthException e) => debugPrint('${e.code}: ${e.message}'),
  codeSent: (String verificationId, int? resendToken) {},
  codeAutoRetrievalTimeout: (String verificationId) {},
);

Verify

codeSent fires for the fictional number every time, and after a pause the real number receives an SMS again.

Verify
adb logcat -s FirebaseAuth

Confirmed by github.com

Did this fix it?

Cause 2 of 2

The user's carrier or region is paused for low delivery success

You seeNumbers from one country code or one mobile network fail on the very first try, while numbers on other networks work

Check

Firebase notes that some carriers are unavailable in certain regions because of poor delivery success rates. Answering an Error code:39 report on the Android SDK tracker, a Firebase contributor explained that carriers or whole regions with consistently low success can become temporarily unavailable.

Check
adb logcat -s FirebaseAuth

Fix

Nothing in the app can force delivery to a paused carrier. Offer another sign-in method when this failure appears, and send your project ID and the affected numbers' country and carrier to Firebase support.

Fix
verificationFailed: (FirebaseAuthException e) {
  if ((e.message ?? '').contains('Error code:39')) {
    showOtherSignInOptions(); // email link or another provider
  }
},

Verify

Users on the affected network can still sign in through the fallback, and numbers on other carriers keep receiving codes.

Verify
adb logcat -s FirebaseAuth

Confirmed by github.com

Did this fix it?

How do I stop it coming back?

  • Keep fictional numbers in the console for every developer and for App Review, so nobody drains the per-number cap with real phones.
  • Log the phone number's country code with each verificationFailed event, so a carrier or region pause stands out in your analytics.
  • Turn on Activity Logging for Authentication so you can count verification codes sent per number.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine on the same stack: SessionBird, Workforce, Spotless Laundry.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.