Ad

Firebase Sign In: GoogleSignIn OnActivityResult() Returns RESULT_CANCELED With Result Error 12500

- 1 answer

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.

Ad

Answer

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

Ad
source: stackoverflow.com
Ad