The signed app works fine but as soon as I upload the app to play store, the firebase phone authentication throws Unexpected response code 400 for https://www.googleapis.com/identitytoolkit/v3/relyingparty/sendVerificationCode? error.
I found a solution much easier to do.. All you need to do is link your Firebase account to your google Play console, you can do this from firebase console. Project settings->Account linking->Google Play. Hope it works for you.
By doing this it will add/register all your app signing certificates SHA1 to firebase