I had the same problem as EmanuelOzorio, let me elaborate what he means.
This solution works in the following case:
If you install the apk directly, you can sign in.
If you upload to the console and download from the store, it gives error 4.
Probably you let google manage your app signing.
In that case, in the OAuth credentials, you should use the SHA-1 fingerprint from the key that google uses to sign your app, and not from your own key.
This SHA-1 fingerprint can be found in the google play console, under settings > app integrity.