Firebase Sign In: GoogleSignIn OnActivityResult() Returns RESULT_CANCELED With Result Error 12500
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:
- Two SHA1 keys - from .android/debug.keystore (for now) and custom release keystore (2 Oauth2 Android Client ID's based on those keys)
- 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
- 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:
- Created custom debug keystore, exported SHA1 and added It into Firebase project (That keystore is used to sign debug)
build.gradle, assigned this debug keystore to debug build type and that is working - it is being signed using that keystore
- Created new Oauth2 Web client id and inserted it in the same way as in PROD for Google Sign in provider
- 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.
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"
Now it's working, I can login.
Hope this will help
Thanks to answer of Pranjal Gupta : Google Sign In error 12500
- → should I choose reactjs+f7 or f7+vue.js?
- → Phonegap Android write to sd card
- → Local reference jquery script in nanohttpd (Android)
- → Click to navigate on mobile devices
- → How to allow api access to android or ios app only(laravel)?
- → Access the Camera and CameraRoll on Android using React Native?
- → React native change listening port
- → What is the default unit of style in React Native?
- → Google play market autocomplete icon
- → Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `ListView`
- → Using Laravel with Genymotion
- → react native using like web-based ajax function
- → react native pdf View