3

I'm using Firebase Authentication in a Flutter app. On iOS everything works perfectly — once a user logs in, they're remembered and automatically authenticated on every app launch. On Android, however, the user is not remembered after the app is closed. They are logged out and sent back to the login screen every time the app is restarted. (exact same logic, and it worked earlier) The Firebase auth itself works, because I can register, sign in again, its just not persisted and FirebaseAuth currentUser is null.

  • Flutter version: 3.24.3
  • Firebase_auth: 5.2.0
  • SDK Version: 35

I’ve already tried:

  • SHA1 and SHA256 are correctly added to Firebase Console

  • google-services.json is downloaded and correctly placed

  • Works fine in debug mode and in release mode locally

  • Tried adding proguard file to keep firebase rules - no success

  • Tried disabling minifyEnabled and shrinkResources - no success

  • The issue only happens in the Play Store release

  • Tested flutter build apk --release → works as expected locally

Its really strange, and really cant figure it out since it cannot be reproduced locally. Anyone faced something similar? https://www.reddit.com/r/Firebase/comments/1n4a6du/bug_flutter_firebase_authentication_remember_not/

1
  • Per the OP, the fix is to add this to your android manifest under Application: android:allowBackup="false" android:fullBackupOnly="false" See this post for details: stackoverflow.com/questions/33169618/… Commented Sep 22 at 16:30

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.