1

Ok, i am aware that this question has been asked multiple times, but for some reason this error keeps happening, this is the scenario:

  • Created PROD firebase project, inserted google-services.json within Android project (Android project path: app/google-services.json) that is working perfectly, contains:

    1. Two SHA1 keys - from .android/debug.keystore (for now) and custom release keystore (2 Oauth2 Android Client ID's based on those keys)
    2. Oauth2 Web Client ID that is used for Google Sign In - I've put them into Firebase Console/Authentication/Providers/Google Sign In/Web SDK Configuration
    3. Firebase Project ID is com.companyname.projectname format
  • Then I created DEV firebase project (app/debug/google-services.json) and i've done the following:

    1. Created custom debug keystore, exported SHA1 and added It into Firebase project (That keystore is used to sign debug)
    2. Within build.gradle, assigned this debug keystore to debug build type and that is working - it is being signed using that keystore
    3. Created new Oauth2 Web client id and inserted it in the same way as in PROD for Google Sign in provider
    4. Firebase Project ID for this project is com.companyname.projectname-dev (added application suffix within build type debug)

When I run app with debug build type, this is what happens:

GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
        .requestIdToken(getString(R.string.default_web_client_id))
        .requestEmail()
        .build();

 GoogleSignInClient googleSignInClient = GoogleSignIn.getClient(this, gso);

This is good - requestIdToken is the Oauth2 Web Client ID from DEV Firebase project

BuildConfig.APPLICATION_ID returns DEV applicationId (with -dev suffix)

But then when I go to onActivityResult(), i get what i get from the title of this question - RESULT_CANCELED + 12500 result error

Has anyone had the same issue?

My apologies for rather chaotic question, i will add more info if necessary.

Note: I have tried using the .android/debug.keystore SHA1 within DEV project, but I had the same issue as the above.

Sekula1991
  • 288
  • 4
  • 17
  • Possible duplicate of [Google Sign In error 12500](https://stackoverflow.com/questions/47632035/google-sign-in-error-12500) – AdamHurwitz Jul 22 '19 at 19:42

2 Answers2

1

What I tried first :

I want through this error ApiException: 12500 for a long time. I tried everthing :

  • remove my debugkeystore, recreate one
  • add support email on firebase console
  • change versions of plugin
  • update google on my device

But when I was browsing stackoverflow, I found a solution :

Maybe the solution :

I went to this page (https://console.developers.google.com/apis/credentials) Do not forget to select your project on the list (top left). Then go on "Oauth consent screen"

I filled almost all the fields : the application logo, the email support, the application homepage link, application privacy policy link (with the project.firebaseapp.com); and I saved.

enter image description here

Now it's working, I can login.

Hope this will help

Source

Thanks to answer of Pranjal Gupta : Google Sign In error 12500

Xero
  • 3,951
  • 4
  • 41
  • 73
  • 1
    I have set support email via Firebase Console/Authentication/Google - and it wasn't working. Once I've set it up within consent screen, it started to work! Crazy stuff, anyways - thanks a lot! – Sekula1991 Jul 15 '19 at 12:20
  • Filled in consent screen, still doesn't work. Hope they don't expect to have an actual domain. You should be able to work without in dev without paying for it at that point. – html_programmer Jan 12 '21 at 22:00
0

My problem was solved when I realized that I had already logged in with the same email through another method. For example, if the user logs in for the first time using the email and password method, when trying to log in via Google login the error will appear. Then, delete the email and try again and you will see that everything is ok. It doesn't make much sense, but this is what happens.

Edeson Bizerril
  • 1,595
  • 1
  • 11
  • 12