OTP not sent in release on Android device

Viewed 168

Phone auth works on a physical iOS device in debug and release, but only in debug for a physical Android device.

I've tried multiple solutions including adding the SHA-1 and SHA-256 to Firestore and downloading the latest google-services file. I've also added "uses-permission android:name="android.permission.INTERNET" to my manifest file.

I've spent weeks on this issue and went so far as to pay for a coding session to see if they could figure it out. No luck. I think I'm missing a permission or something for release because it works until I run "flutter run --release" or upload it to the Google Play store.

Does anyone have any ideas on how I could fix this issue?

2 Answers

Some solutions that can help you solve the problem:

  • After the process of repeating the same process, sending the code to the same phone number, Firebase will block for a whole day. Please take this point into account and you should use the trial system only in the debug stage.

  • In the release stage, you must add the SHA-1 issued by Google and it will work normally.

  • I had the same problem and discovered that the solution to this problem was not from the code that I wrote, the problem appeared in the telecom network distributors inside the country in which I found and I contacted them and the problem was already solved.

  1. Did you add sha 1 (from keystore) to firebase?

if not then add sha1.

how to get sha1 from key store

  1. Download keystore explorer Download link
  2. Install keystore explorer
  3. Open keystore via keystore explorer
  4. Enter password
  5. Click your keystore name
  6. then you will get the sha1 key
Related