This [firebase_auth/invalid-credential] The supplied auth credential is malformed or has expired could be an weird behavior. This could happen due to many reasons. This mostly happen on Android emulator.
Solution
I have encountered a weird one. This one happened due to emulator. I had to delete the app, reboot the emulator and reinstalled the app. And it worked.
You may confirm that it’s weird by running the same app on the iOS simulator.