Can't get realm google auth to work with my android app

I am trying to get google auth working with my android app.
I have an IOS app that connected to the same realm app and the google auth works there.
But for some reason, it can’t work with the android app.
I keep getting error 12500.

What can the problem be?


// Configure sign-in to request the user’s ID, email address, and basic
// profile. ID and basic profile are included in DEFAULT_SIGN_IN.
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
// Build a GoogleSignInClient with the options specified by gso.
mGoogleSignInClient = GoogleSignIn.getClient(this, gso);

    // Check for existing Google Sign In account, if the user is already signed in
    // the GoogleSignInAccount will be non-null.
    GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(this);

// updateUI(account);

I’m also having this issue. The documentation is out of date. There are two problems I can see;

Firstly, using the web client id from GCP always returns an error, either error exchanging access code with OAuth2 provider when using serverAuthCode or crypto/rsa: verification error when using the idToken.

The second problem is that for iOS auth to work, the Google Auth Provider in Realm has to be set up using the iOS client id from GCP. Using this means that trying to open the auth page within your Android app will not work (it returns a result of CANCELLED, as it does if you try to use an Android client id from GCP), as it is expecting a web client id.

I have opened an issue in Realm/Java here: Google sign in using the documentation as provided does not work · Issue #7578 · realm/realm-java · GitHub