0

My Firebase sign in functions no longer work once my app is published to Play Store. Register methods work perfectly fine, however. Sign in works perfectly on iOS, my device while debugging (in both debug/release modes), and all emulators. What might be going on here?

I have added the SHA 1 key from the Play Store, and yes it's the correct one. In fact, I have added the SHA 1 Upload key and debug key to Firebase too (so 3 SHA 1 keys total). I confirmed these show up in the Google Developer Console too. Firebase is properly connected, but for whatever reason this is happening. Here's an example of one of my sign-in methods. I get hung up on signInWithEmailandPassword()...if there's an error (wrong password, for example) I do properly receive an error message. Otherwise, this method hangs forever.

    //sign in with email & password
  Future signInWithEmailAndPassword(String email, String password) async {
    try {
      final auth.UserCredential result = await _auth.signInWithEmailAndPassword(email: email, password: password);
      final auth.User user = result.user;

      if (user.emailVerified) {
        return _userFromFirebaseUser(user); 
      }
      else {
        return user;
      }    

    } catch(e) {
      print(e.toString());
      return null;
    }
  }

(In addition, my Google Sign-in dependency is wonky in release, and I get an error stating that there's some missing implementation (maybe a result from v2 embedding?) -- but that's an unrelated issue if it isn't related to a solution to my main question.)

nickinspace
  • 113
  • 2
  • 9
  • Please limit yourself to a single question on Stack Overflow, or it might be closed as "needs focus". I suggest also adding the specific code that doesn't work the way you expect, along with any error messages. You can edit the question using the edit link at the bottom. – Doug Stevenson Dec 28 '20 at 05:28
  • @DougStevenson I tried to make it more clear. I'm just so confused how everything works perfectly until I try to release to the Play Store, for internal testing no less. No errors during build. – nickinspace Dec 28 '20 at 05:35
  • https://console.cloud.google.com/apis/library/androidcheck.googleapis.com?pli=1, did you enable this? – Yadu Dec 28 '20 at 05:37
  • @Yadu I didn’t initially, no. Just tried it now too and I’m getting the same result. – nickinspace Dec 28 '20 at 05:47
  • log the response while sign in release mode `flutter run --release` – Yadu Dec 28 '20 at 06:04
  • when I run via flutter run --release I face no errors whatsoever. I only see these errors when I try to publish via Internal Testing to the Play Store. Do you still want the log? – nickinspace Dec 28 '20 at 06:58
  • Sooo I just uploaded that same apk from running flutter run —release and THAT one works from the Play Store. So something must go wrong when I try to build an apk/app bundle. Honestly though, I’m fine with this at the moment. – nickinspace Dec 28 '20 at 07:19
  • are you using `flutter build appbundle` to build?, debugging this will help future ppl coming across this – Yadu Dec 28 '20 at 11:08
  • I am, although I ran into the same issue when I tried to use flutter build apk – nickinspace Dec 28 '20 at 15:45

1 Answers1

0

Reference this answer -- it solved my Google Sign in problem AND the rest of my auth sign-ins.

https://stackoverflow.com/a/65511857/14834849

nickinspace
  • 113
  • 2
  • 9